mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r24515) -Fix: GStexts were compied incompletely when containing certain string codes.
This commit is contained in:
parent
8c8207dcc8
commit
2ec6136113
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue