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
commit94dd23aaf86cb1c22ce78d8555261d045de0ee60 (patch)
tree5d55ad88140d1419264dede62b3798afdf9a8cc6
parentf7a52c4444a5ef00a1d84362c0af02bd982e67d2 (diff)
downloadopenttd-94dd23aaf86cb1c22ce78d8555261d045de0ee60.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;