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
commit494c56475f04f0753d1ef7b8126612d3017df861 (patch)
treebbd2a7ac7e0c3b558bf638e1779108ced158cb6a /texteff.c
parentc15e699479ca81045db05af98ad86452b97572fd (diff)
downloadopenttd-494c56475f04f0753d1ef7b8126612d3017df861.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);