Skip to content

Commit

Permalink
Revert "- fixed allocation size when constructing a string from a fil…
Browse files Browse the repository at this point in the history
…e system entry."

This reverts commit 513d8ce.

This change broke voxel loading and possibly other things as well
  • Loading branch information
coelckers committed Sep 4, 2022
1 parent 664ccf8 commit 8cba80a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/common/filesystem/filesystem.cpp
Expand Up @@ -1608,17 +1608,17 @@ FileData::~FileData ()
{
}

FString::FString(ELumpNum lumpnum)
FString::FString (ELumpNum lumpnum)
{
auto lumpr = fileSystem.OpenFileReader((int)lumpnum);
auto size = lumpr.GetLength();
AllocBuffer(size);
auto numread = lumpr.Read(&Chars[0], size);
auto lumpr = fileSystem.OpenFileReader ((int)lumpnum);
auto size = lumpr.GetLength ();
AllocBuffer (1 + size);
auto numread = lumpr.Read (&Chars[0], size);
Chars[size] = '\0';

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));
}
}
Expand Down

0 comments on commit 8cba80a

Please sign in to comment.