(svn r15385) -Fix: Saving of char* to configuration file did not work due to incorrect parameter order and no handling of NULL.

This commit is contained in:
peter1138 2009-02-07 00:29:35 +00:00
parent eb533138bc
commit cd84ffb036
1 changed files with 7 additions and 1 deletions

View File

@ -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();
}