summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/settings.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/settings.cpp b/src/settings.cpp
index 9a47d0840..072f04322 100644
--- a/src/settings.cpp
+++ b/src/settings.cpp
@@ -567,7 +567,13 @@ static void ini_save_settings(IniFile *ini, const SettingDesc *sd, const char *g
case SLE_VAR_STRB: strcpy(buf, (char*)ptr); break;
case SLE_VAR_STRBQ:seprintf(buf, lastof(buf), "\"%s\"", (char*)ptr); break;
case SLE_VAR_STR: strcpy(buf, *(char**)ptr); break;
- case SLE_VAR_STRQ: seprintf(buf, "\"%s\"", lastof(buf), *(char**)ptr); break;
+ case SLE_VAR_STRQ:
+ if (*(char**)ptr == NULL) {
+ buf[0] = '\0';
+ } else {
+ seprintf(buf, lastof(buf), "\"%s\"", *(char**)ptr);
+ }
+ break;
case SLE_VAR_CHAR: buf[0] = *(char*)ptr; buf[1] = '\0'; break;
default: NOT_REACHED();
}