- append an empty line to thr RFS file to be parsed.

Looks like the parser needs the last line to be properly terminated.
This commit is contained in:
Christoph Oelckers 2021-08-13 21:43:33 +02:00
parent 8765b583f0
commit d5c9768414
1 changed files with 3 additions and 2 deletions

View File

@ -218,7 +218,7 @@ int RFS::Open(int lumpnum)
}
int fileSize = (int)hFile.GetLength();
buffer.Resize(fileSize);
buffer.Resize(fileSize+1);
_ptr = buffer.Data();
if (_ptr == NULL) {
Printf("BARF: Not enough memory to read %d", lumpnum);
@ -226,11 +226,12 @@ int RFS::Open(int lumpnum)
}
hFile.Read(_ptr, fileSize);
buffer[fileSize] = '\n';
_curLine = 0;
_pUnknown2 = _ptr;
_curChar = '\n';
_pEnd = &_ptr[fileSize - 1];
_pEnd = &_ptr[fileSize];
return 0;
}