summaryrefslogtreecommitdiff
path: root/app/wlib/gtklib/wpref.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2020-08-08 11:53:00 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2020-08-08 11:53:00 +0200
commitb623f5953691b2a0614e6f1f4def86bdbb9a4113 (patch)
tree18102bd36f7e22eb2ba2b9f880e4cb29346f4cb8 /app/wlib/gtklib/wpref.c
parent359b557176b9bb2ff1aed2082641eed39c358d0d (diff)
New upstream version 5.2.0Beta2.1upstream/5.2.0Beta2.1
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 );
}