summaryrefslogtreecommitdiff
path: root/src/strgen
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-04-10 20:37:05 +0000
committerrubidium <rubidium@openttd.org>2009-04-10 20:37:05 +0000
commitbee930f9b3b9dad52945c1186227519cf9d566aa (patch)
tree4316044d109b49be7854ac19dd38cbc7d94367c1 /src/strgen
parent4bf35086802f6f778e987cf0a4ca377068cb27ed (diff)
downloadopenttd-bee930f9b3b9dad52945c1186227519cf9d566aa.tar.xz
(svn r16024) -Codechange: harden string copying on places where it's possible
Diffstat (limited to 'src/strgen')
-rw-r--r--src/strgen/strgen.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/strgen/strgen.cpp b/src/strgen/strgen.cpp
index 6bec63094..b769d55fe 100644
--- a/src/strgen/strgen.cpp
+++ b/src/strgen/strgen.cpp
@@ -1193,9 +1193,9 @@ static void WriteLangfile(const char *filename)
hdr.text_dir = _lang_textdir;
hdr.winlangid = TO_LE16(_lang_winlangid);
hdr.newgrflangid = _lang_newgrflangid;
- strcpy(hdr.name, _lang_name);
- strcpy(hdr.own_name, _lang_ownname);
- strcpy(hdr.isocode, _lang_isocode);
+ strecpy(hdr.name, _lang_name, lastof(hdr.name));
+ strecpy(hdr.own_name, _lang_ownname, lastof(hdr.own_name));
+ strecpy(hdr.isocode, _lang_isocode, lastof(hdr.isocode));
fwrite(&hdr, sizeof(hdr), 1, f);