summaryrefslogtreecommitdiff
path: root/app/wlib/gtklib/wpref.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2020-08-22 14:05:41 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2020-08-22 14:05:41 +0200
commitb55285a77da0e0b829e4ce8d7e09debaabc68e15 (patch)
treef622559ef65bbdd3e1c5bdb06098a8f89eec0563 /app/wlib/gtklib/wpref.c
parentd3897ce090dbeb220ed2c782f095597e417cf3cc (diff)
parentd1ae75703e1ed81d65ea16946dcdb77e7a13adc9 (diff)
Merge branch 'feature/upstream' into develop
Diffstat (limited to 'app/wlib/gtklib/wpref.c')
-rw-r--r--app/wlib/gtklib/wpref.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/app/wlib/gtklib/wpref.c b/app/wlib/gtklib/wpref.c
index c2541f9..124305a 100644
--- a/app/wlib/gtklib/wpref.c
+++ b/app/wlib/gtklib/wpref.c
@@ -168,7 +168,7 @@ const char * wGetAppWorkDir(
if ( stat( appEtcConfig, &stFileInfo ) == 0 ) {
char copyConfigCmd[(BUFSIZ * 2) + 3];
sprintf( copyConfigCmd, "cp %s %s", appEtcConfig, appWorkDir );
- system( copyConfigCmd );
+ int rc = system( copyConfigCmd );
}
}
}
@@ -293,7 +293,7 @@ void wPrefSetString(
if (p->val)
free(p->val);
p->dirty = TRUE;
- p->val = strdup( sval );
+ p->val = (sval?strdup( sval ):NULL);
return;
}
}
@@ -302,7 +302,7 @@ void wPrefSetString(
p->name = strdup(name);
p->section = strdup(section);
p->dirty = TRUE;
- p->val = strdup(sval);
+ p->val = (sval?strdup(sval):NULL);
}
/**
@@ -456,7 +456,9 @@ void wPrefFlush(
return;
for (p=&prefs(0); p<&prefs(prefs_da.cnt); p++) {
- fprintf( prefFile, "%s.%s: %s\n", p->section, p->name, p->val );
+ if(p->val) {
+ fprintf( prefFile, "%s.%s: %s\n", p->section, p->name, p->val );
+ }
}
fclose( prefFile );
}