diff options
author | rubidium <rubidium@openttd.org> | 2008-09-29 16:27:02 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2008-09-29 16:27:02 +0000 |
commit | e7829c1a57014f8b40b4972ab5b45dbcf4bb067d (patch) | |
tree | 43b0c8873ef3d08bb3099e46a3bc152bc8cd010d /src/namegen.cpp | |
parent | a25d9bcc8b771e365097d96a459bca1b36c53408 (diff) | |
download | openttd-e7829c1a57014f8b40b4972ab5b45dbcf4bb067d.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.cpp | 2 |
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) |