diff --git a/data/dynos_bin_read.cpp b/data/dynos_bin_read.cpp index 5dba78b6..e19aef5d 100644 --- a/data/dynos_bin_read.cpp +++ b/data/dynos_bin_read.cpp @@ -104,6 +104,9 @@ char *DynOS_Read_Buffer(FILE* aFile, GfxData* aGfxData) { } } + // Make sure it's NULL terminated + _FileBuffer[_Length] = '\0'; + return _FileBuffer; } @@ -142,6 +145,9 @@ void DynOS_Read_Source(GfxData *aGfxData, const SysPath &aFilename) { while (*c != '\n' && *c != '\0') { c++; } + if (*c == '\0') { + break; + } } // Reading data type name