summaryrefslogtreecommitdiff
path: root/src/genworld_gui.cpp
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2008-10-22 19:12:10 +0000
committersmatz <smatz@openttd.org>2008-10-22 19:12:10 +0000
commitbc1d994f6c3a1f81b2d5c71a4b656bab4e776d81 (patch)
tree43f6f4d436dced1e168f6a66c84f0027a6db24bd /src/genworld_gui.cpp
parent852940b45b6ce895998e8455564d5a47bceddb5b (diff)
downloadopenttd-bc1d994f6c3a1f81b2d5c71a4b656bab4e776d81.tar.xz
(svn r14514) -Codechange: use 'size' instead of 'length' for querystring and textbuf, explicitly say it includes the terminating zero
-Fix: one couldn't rename things with too long default/automatic name -Fix: buffer overflow in console when too long (1024 bytes) command was entered
Diffstat (limited to 'src/genworld_gui.cpp')
-rw-r--r--src/genworld_gui.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/genworld_gui.cpp b/src/genworld_gui.cpp
index 565a898c3..6091d75b6 100644
--- a/src/genworld_gui.cpp
+++ b/src/genworld_gui.cpp
@@ -255,6 +255,7 @@ struct GenerateLandscapeWindow : public QueryStringBaseWindow {
{
this->LowerWidget(_settings_newgame.game_creation.landscape + GLAND_TEMPERATE);
+ /* snprintf() always outputs trailing '\0', so whole buffer can be used */
snprintf(this->edit_str_buf, this->edit_str_size, "%u", _settings_newgame.game_creation.generation_seed);
InitializeTextBuffer(&this->text, this->edit_str_buf, this->edit_str_size, 120);
this->caption = STR_NULL;