summaryrefslogtreecommitdiff
path: root/genworld_gui.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-11-07 12:03:34 +0000
committertron <tron@openttd.org>2006-11-07 12:03:34 +0000
commitdb98136bedbb4d05ce83c7dcbfb3a3d59142967a (patch)
treedd4a01fb2311f9ba121e3fcfd08149106eb12c5e /genworld_gui.c
parentca8605ebc5fa979fba1e6f21092949f09dd2b2a3 (diff)
downloadopenttd-db98136bedbb4d05ce83c7dcbfb3a3d59142967a.tar.xz
(svn r7091) Make some code a) shorter b) simpler c) not leak memory
Diffstat (limited to 'genworld_gui.c')
-rw-r--r--genworld_gui.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/genworld_gui.c b/genworld_gui.c
index db10f9258..cd597b893 100644
--- a/genworld_gui.c
+++ b/genworld_gui.c
@@ -320,7 +320,7 @@ void GenerateLandscapeWndProc(Window *w, WindowEvent *e)
break;
case 16: // Random seed
_patches_newgame.generation_seed = InteractiveRandom();
- ttd_strlcpy(_edit_str_buf, str_fmt("%u", _patches_newgame.generation_seed), lengthof(_edit_str_buf));
+ snprintf(_edit_str_buf, lengthof(_edit_str_buf), "%u", _patches_newgame.generation_seed);
UpdateTextBufferSize(&WP(w, querystr_d).text);
SetWindowDirty(w);
break;
@@ -506,7 +506,7 @@ static void _ShowGenerateLandscape(glwp_modes mode)
if (w != NULL) {
querystr_d *querystr = &WP(w, querystr_d);
- ttd_strlcpy(_edit_str_buf, str_fmt("%u", _patches_newgame.generation_seed), lengthof(_edit_str_buf));
+ snprintf(_edit_str_buf, lengthof(_edit_str_buf), "%u", _patches_newgame.generation_seed);
InitializeTextBuffer(&querystr->text, _edit_str_buf, lengthof(_edit_str_buf), 120);
querystr->caption = STR_NULL;