diff options
Diffstat (limited to 'lexlib/WordList.cxx')
-rw-r--r-- | lexlib/WordList.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lexlib/WordList.cxx b/lexlib/WordList.cxx index 1f7127999..e789c0eaf 100644 --- a/lexlib/WordList.cxx +++ b/lexlib/WordList.cxx @@ -122,8 +122,9 @@ static void SortWordList(char **words, unsigned int len) { void WordList::Set(const char *s) { Clear(); - list = new char[strlen(s) + 1]; - strcpy(list, s); + const size_t lenS = strlen(s) + 1; + list = new char[lenS]; + memcpy(list, s, lenS); words = ArrayFromWordList(list, &len, onlyLineEnds); #ifdef _MSC_VER std::sort(words, words + len, cmpWords); |