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
1 changed files with 2 additions and 1 deletions

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) {