diff options
author | rubidium <rubidium@openttd.org> | 2008-12-23 20:50:09 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2008-12-23 20:50:09 +0000 |
commit | 94dd23aaf86cb1c22ce78d8555261d045de0ee60 (patch) | |
tree | 5d55ad88140d1419264dede62b3798afdf9a8cc6 /src | |
parent | f7a52c4444a5ef00a1d84362c0af02bd982e67d2 (diff) | |
download | openttd-94dd23aaf86cb1c22ce78d8555261d045de0ee60.tar.xz |
(svn r14729) -Fix: writing a single char to the config file caused reading outside a buffer.
Diffstat (limited to 'src')
-rw-r--r-- | src/settings.cpp | 2 |
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; |