1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-25 07:44:38 +01:00

Null-terminate buffer read from language packs

This commit is contained in:
Michał Janiszewski
2015-09-14 22:58:14 +02:00
parent 5abc574593
commit 34f56a262b

View File

@@ -28,8 +28,9 @@ LanguagePack *LanguagePack::FromFile(int id, const utf8 *path)
FileStream fs = FileStream(path, FILE_MODE_OPEN);
fileLength = (uint32)fs.GetLength();
fileData = Memory::Allocate<utf8>(fileLength);
fileData = Memory::Allocate<utf8>(fileLength + 1);
fs.Read(fileData, fileLength);
fileData[fileLength] = '\0';
fs.Dispose();
} catch (Exception ex) {