(svn r20220) -Fix [FS#3974]: strip non-printable characters before showing it in an edit box, so when renaming a vehicle type you won't get the "SETX stuff" that some NewGRFs use

This commit is contained in:
rubidium
2010-07-25 23:14:59 +00:00
parent 757f80c2b4
commit f48fca6bfc
3 changed files with 21 additions and 2 deletions

View File

@@ -1282,7 +1282,7 @@ struct QueryStringWindow : public QueryStringBaseWindow
QueryStringBaseWindow(maxsize)
{
GetString(this->edit_str_buf, str, &this->edit_str_buf[maxsize - 1]);
this->edit_str_buf[maxsize - 1] = '\0';
str_validate(this->edit_str_buf, &this->edit_str_buf[maxsize - 1], false, true);
if ((flags & QSF_ACCEPT_UNCHANGED) == 0) this->orig = strdup(this->edit_str_buf);