From 5ab74534da3f94cd1c43bc438dcc0d31b23408e5 Mon Sep 17 00:00:00 2001 From: rubidium Date: Mon, 29 Sep 2008 16:27:02 +0000 Subject: (svn r14414) -Fix: replace instances of strncpy with strecpy as strncpy doesn't guarantee the resulting string is '\0'-terminated. --- src/namegen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/namegen.cpp') 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) -- cgit v1.2.3-54-g00ecf