diff options
author | frosch <frosch@openttd.org> | 2012-09-09 15:52:49 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2012-09-09 15:52:49 +0000 |
commit | 2ec61361135d004300f3f7f1071d7fd6f8cf204d (patch) | |
tree | 29d38bca50cf5fb32f6cd3b36ac2904dd5a23b56 | |
parent | 8c8207dcc820a204d26c6c680fa2c22adb29e826 (diff) | |
download | openttd-2ec61361135d004300f3f7f1071d7fd6f8cf204d.tar.xz |
(svn r24515) -Fix: GStexts were compied incompletely when containing certain string codes.
-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; } }; |