summaryrefslogtreecommitdiff
path: root/src/namegen.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-09-29 16:27:02 +0000
committerrubidium <rubidium@openttd.org>2008-09-29 16:27:02 +0000
commit5ab74534da3f94cd1c43bc438dcc0d31b23408e5 (patch)
tree43b0c8873ef3d08bb3099e46a3bc152bc8cd010d /src/namegen.cpp
parentd34da3cadbd0e7776244fc45915f23b1e9f28c7f (diff)
downloadopenttd-5ab74534da3f94cd1c43bc438dcc0d31b23408e5.tar.xz
(svn r14414) -Fix: replace instances of strncpy with strecpy as strncpy doesn't guarantee the resulting string is '\0'-terminated.
Diffstat (limited to 'src/namegen.cpp')
-rw-r--r--src/namegen.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/namegen.cpp b/src/namegen.cpp
index cd6cba2ea..d9fa7c97d 100644
--- a/src/namegen.cpp
+++ b/src/namegen.cpp
@@ -36,7 +36,7 @@ static inline int32 SeedChanceBias(int shift_by, int max, uint32 seed, int bias)
static void ReplaceWords(const char *org, const char *rep, char *buf)
{
- if (strncmp(buf, org, 4) == 0) strncpy(buf, rep, 4);
+ if (strncmp(buf, org, 4) == 0) strncpy(buf, rep, 4); // Safe as the string in buf is always more than 4 characters long.
}
static byte MakeEnglishOriginalTownName(char *buf, uint32 seed, const char *last)