summaryrefslogtreecommitdiff
path: root/texteff.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 /texteff.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 'texteff.c')
-rw-r--r--texteff.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/texteff.c b/texteff.c
index 982b964a9..cd1d0a9d3 100644
--- a/texteff.c
+++ b/texteff.c
@@ -246,7 +246,7 @@ void AddTextEffect(StringID msg, int x, int y, uint16 duration)
te->params_1 = GetDParam(0);
te->params_2 = GetDParam(4);
- GetString(buffer, msg);
+ GetString(buffer, msg, lastof(buffer));
w = GetStringBoundingBox(buffer).width;
te->x = x - (w >> 1);