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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user