summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-12-23 20:50:09 +0000
committerrubidium <rubidium@openttd.org>2008-12-23 20:50:09 +0000
commit258ebb81732d24f67b66978b12e74dd0d8855433 (patch)
tree5d55ad88140d1419264dede62b3798afdf9a8cc6
parent2576aceb217c48a3b6e0ed59de4d185c8d021ea8 (diff)
downloadopenttd-258ebb81732d24f67b66978b12e74dd0d8855433.tar.xz
(svn r14729) -Fix: writing a single char to the config file caused reading outside a buffer.
-rw-r--r--src/settings.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/settings.cpp b/src/settings.cpp
index 3c2bac2ef..4fe78d398 100644
--- a/src/settings.cpp
+++ b/src/settings.cpp
@@ -572,7 +572,7 @@ static void ini_save_settings(IniFile *ini, const SettingDesc *sd, const char *g
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_CHAR: seprintf(buf, "\"%c\"", lastof(buf), *(char*)ptr); break;
+ case SLE_VAR_CHAR: buf[0] = *(char*)ptr; buf[1] = '\0'; break;
default: NOT_REACHED();
}
break;