(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:
@@ -41,10 +41,11 @@ struct QueryString {
|
||||
struct QueryStringBaseWindow : public Window, public QueryString {
|
||||
char *edit_str_buf;
|
||||
char *orig_str_buf;
|
||||
const uint16 edit_str_size;
|
||||
const uint16 edit_str_size; ///< maximum length of string (in bytes), including terminating '\0'
|
||||
|
||||
QueryStringBaseWindow(uint16 size, const WindowDesc *desc, WindowNumber window_number = 0) : Window(desc, window_number), edit_str_size(size)
|
||||
{
|
||||
assert(size != 0);
|
||||
this->edit_str_buf = CallocT<char>(size);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user