summaryrefslogtreecommitdiff
path: root/news_gui.c
diff options
context:
space:
mode:
authorDarkvater <darkvater@openttd.org>2006-10-21 23:31:34 +0000
committerDarkvater <darkvater@openttd.org>2006-10-21 23:31:34 +0000
commitee27bb497c0790d86da6025fa48034f01f36d6e0 (patch)
treebbd2a7ac7e0c3b558bf638e1779108ced158cb6a /news_gui.c
parent7f36a980c70d2444a68af5046e47c0313d67b2ef (diff)
downloadopenttd-ee27bb497c0790d86da6025fa48034f01f36d6e0.tar.xz
(svn r6884) -Codechange: Add strict bounds checking in string formatting system.
The last parameter should point to the end of the buffer (eg lastof(buf)) Courtesy of Tron.
Diffstat (limited to 'news_gui.c')
-rw-r--r--news_gui.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/news_gui.c b/news_gui.c
index fa56a6ea0..498009108 100644
--- a/news_gui.c
+++ b/news_gui.c
@@ -579,7 +579,7 @@ static void DrawNewsString(int x, int y, uint16 color, const NewsItem *ni, uint
str = ni->string_id;
}
- GetString(buffer, str);
+ GetString(buffer, str, lastof(buffer));
/* Copy the just gotten string to another buffer to remove any formatting
* from it such as big fonts, etc. */
for (ptr = buffer, dest = buffer2; *ptr != '\0'; ptr++) {