summaryrefslogtreecommitdiff
path: root/misc_gui.c
diff options
context:
space:
mode:
authorpasky <pasky@openttd.org>2004-11-22 21:41:25 +0000
committerpasky <pasky@openttd.org>2004-11-22 21:41:25 +0000
commit3ee0dee12a06c26f0984028a1a56a3f3b240447f (patch)
tree4db8a64449865edaa93d47db6cc195f0d1893632 /misc_gui.c
parentd4b723a7c9f653f134b33f1d7a130c6b996c1f75 (diff)
downloadopenttd-3ee0dee12a06c26f0984028a1a56a3f3b240447f.tar.xz
(svn r767) Introduce USERSTRING_LEN (128) and try to make sure we don't overflow it anywhere (as long as we keep USERSTRING_LEN above 7 or so).
Diffstat (limited to 'misc_gui.c')
-rw-r--r--misc_gui.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/misc_gui.c b/misc_gui.c
index 7ca26c09e..8e1957c46 100644
--- a/misc_gui.c
+++ b/misc_gui.c
@@ -53,7 +53,7 @@ static void LandInfoWndProc(Window *w, WindowEvent *e)
}
DrawStringCentered(140, 38, str, 0);
- sprintf(_userstring, "%.4X", lid->tile);
+ snprintf(_userstring, USERSTRING_LEN, "%.4X", lid->tile);
SET_DPARAM16(0, GET_TILE_X(lid->tile));
SET_DPARAM16(1, GET_TILE_Y(lid->tile));
SET_DPARAM16(2, STR_SPEC_USERSTRING);