From bee930f9b3b9dad52945c1186227519cf9d566aa Mon Sep 17 00:00:00 2001 From: rubidium Date: Fri, 10 Apr 2009 20:37:05 +0000 Subject: (svn r16024) -Codechange: harden string copying on places where it's possible --- src/strgen/strgen.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/strgen') 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); -- cgit v1.2.3-70-g09d2