(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
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user