summaryrefslogtreecommitdiff
path: root/engine.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-07-26 19:04:19 +0000
committertron <tron@openttd.org>2005-07-26 19:04:19 +0000
commita16418266e0cb317b2f338e5ca6e3d1aabdf67c5 (patch)
treedbb913c2b20dd2004ca5b9c2607ba47217ab2ca4 /engine.c
parent7e65f441689917d9d476bc458dec303a0d4e4b7c (diff)
downloadopenttd-a16418266e0cb317b2f338e5ca6e3d1aabdf67c5.tar.xz
(svn r2717) Move _userstring to strings.[ch]
Diffstat (limited to 'engine.c')
-rw-r--r--engine.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/engine.c b/engine.c
index 77b9d977a..47e5a6e93 100644
--- a/engine.c
+++ b/engine.c
@@ -4,6 +4,8 @@
#include "openttd.h"
#include "debug.h"
#include "functions.h"
+#include "string.h"
+#include "strings.h"
#include "table/strings.h"
#include "engine.h"
#include "table/engines.h"
@@ -747,8 +749,7 @@ StringID GetCustomEngineName(int engine)
{
if (!_engine_custom_names[engine])
return _engine_name_strings[engine];
- strncpy(_userstring, _engine_custom_names[engine], USERSTRING_LEN);
- _userstring[USERSTRING_LEN - 1] = '\0';
+ ttd_strlcpy(_userstring, _engine_custom_names[engine], lengthof(_userstring));
return STR_SPEC_USERSTRING;
}