Revert "- fixed allocation size when constructing a string from a file system entry."

This reverts commit 513d8cea8d.

This change broke voxel loading and possibly other things as well
This commit is contained in:
Christoph Oelckers 2022-09-04 08:58:45 +02:00
parent 664ccf8a7c
commit 8cba80a2cd

View file

@ -1608,17 +1608,17 @@ FileData::~FileData ()
{ {
} }
FString::FString(ELumpNum lumpnum) FString::FString (ELumpNum lumpnum)
{ {
auto lumpr = fileSystem.OpenFileReader((int)lumpnum); auto lumpr = fileSystem.OpenFileReader ((int)lumpnum);
auto size = lumpr.GetLength(); auto size = lumpr.GetLength ();
AllocBuffer(size); AllocBuffer (1 + size);
auto numread = lumpr.Read(&Chars[0], size); auto numread = lumpr.Read (&Chars[0], size);
Chars[size] = '\0'; Chars[size] = '\0';
if (numread != size) if (numread != size)
{ {
I_Error("ConstructStringFromLump: Only read %ld of %ld bytes on lump %i (%s)\n", I_Error ("ConstructStringFromLump: Only read %ld of %ld bytes on lump %i (%s)\n",
numread, size, lumpnum, fileSystem.GetFileFullName((int)lumpnum)); numread, size, lumpnum, fileSystem.GetFileFullName((int)lumpnum));
} }
} }