diff options
-rw-r--r-- | src/game/game_text.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/game/game_text.cpp b/src/game/game_text.cpp index 4ffaa9e54..4085d5d25 100644 --- a/src/game/game_text.cpp +++ b/src/game/game_text.cpp @@ -183,7 +183,10 @@ struct TranslationWriter : LanguageWriter { void Write(const byte *buffer, size_t length) { - *this->strings->Append() = strndup((const char*)buffer, length); + char *dest = MallocT<char>(length + 1); + memcpy(dest, buffer, length); + dest[length] = '\0'; + *this->strings->Append() = dest; } }; |