diff options
author | Darkvater <darkvater@openttd.org> | 2006-04-06 19:11:41 +0000 |
---|---|---|
committer | Darkvater <darkvater@openttd.org> | 2006-04-06 19:11:41 +0000 |
commit | b68b9b149a5a0c969de94f192420d953c14b1109 (patch) | |
tree | 0c757bee941699bbd6bd6b5291cf2d22688471e2 /network_gui.c | |
parent | 558ecb16317bccb53e534f561c659844bcd89df5 (diff) | |
download | openttd-b68b9b149a5a0c969de94f192420d953c14b1109.tar.xz |
(svn r4301) - Fix: the maxlength parameter of Textbuf is supposed to be the size of the buffer (so length of string + '\0'), but in the code it was a mix of both. It didn't cause any problems though, only an occasionaly one-less character than allowed. (thanks Tron for noticing)
Diffstat (limited to 'network_gui.c')
-rw-r--r-- | network_gui.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/network_gui.c b/network_gui.c index f27a44136..db970c493 100644 --- a/network_gui.c +++ b/network_gui.c @@ -568,7 +568,7 @@ void ShowNetworkGameWindow(void) w->vscroll.cap = 12; querystr->text.caret = true; - querystr->text.maxlength = MAX_QUERYSTR_LEN - 1; + querystr->text.maxlength = MAX_QUERYSTR_LEN; querystr->text.maxwidth = 120; querystr->text.buf = _edit_str_buf; UpdateTextBufferSize(&querystr->text); @@ -782,7 +782,7 @@ static void ShowNetworkStartServerWindow(void) w->vscroll.count = _fios_num+1; WP(w, network_ql_d).q.text.caret = true; - WP(w, network_ql_d).q.text.maxlength = MAX_QUERYSTR_LEN - 1; + WP(w, network_ql_d).q.text.maxlength = MAX_QUERYSTR_LEN; WP(w, network_ql_d).q.text.maxwidth = 160; WP(w, network_ql_d).q.text.buf = _edit_str_buf; UpdateTextBufferSize(&WP(w, network_ql_d).q.text); @@ -1584,7 +1584,7 @@ void ShowChatWindow(StringID str, StringID caption, int maxlen, int maxwidth, Wi WP(w,querystr_d).wnd_class = window_class; WP(w,querystr_d).wnd_num = window_number; WP(w,querystr_d).text.caret = false; - WP(w,querystr_d).text.maxlength = maxlen - 1; + WP(w,querystr_d).text.maxlength = maxlen; WP(w,querystr_d).text.maxwidth = maxwidth; WP(w,querystr_d).text.buf = _edit_str_buf; UpdateTextBufferSize(&WP(w, querystr_d).text); |