From 2ec61361135d004300f3f7f1071d7fd6f8cf204d Mon Sep 17 00:00:00 2001 From: frosch Date: Sun, 9 Sep 2012 15:52:49 +0000 Subject: (svn r24515) -Fix: GStexts were compied incompletely when containing certain string codes. --- src/game/game_text.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/game') 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(length + 1); + memcpy(dest, buffer, length); + dest[length] = '\0'; + *this->strings->Append() = dest; } }; -- cgit v1.2.3-70-g09d2