mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-16 00:12:51 +00:00
(svn r24515) -Fix: GStexts were compied incompletely when containing certain string codes.
This commit is contained in:
parent
672dfdc90e
commit
e883ca1d4e
@ -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
Block a user