mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-30 01:48:15 +03:00
Fix font .txt files not being null-terminated
This was an oversight when we migrated to the new UTF-8 system - it expects a null-terminated string, but the utfcpp implementation worked with a pointer to the end of the file instead. I also added an assert in FILESYSTEM_loadFileToMemory() so this is less likely to happen again - because there should be no valid reason to have a NULL pointer for the total file size, as well as not wanting a null terminator to be added at the end of the file.
This commit is contained in:
committed by
Misa Elizabeth Kai
parent
4398861d50
commit
df577c59ef
@@ -346,7 +346,7 @@ static uint8_t load_font(FontContainer* container, const char* name)
|
||||
unsigned char* charmap = NULL;
|
||||
if (FILESYSTEM_areAssetsInSameRealDir(name_png, name_txt))
|
||||
{
|
||||
FILESYSTEM_loadAssetToMemory(name_txt, &charmap, NULL, false);
|
||||
FILESYSTEM_loadAssetToMemory(name_txt, &charmap, NULL, true);
|
||||
}
|
||||
if (charmap != NULL)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user