From 8cba80a2cd24a544ae3f4e27fab0a60820278cf3 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 4 Sep 2022 08:58:45 +0200 Subject: [PATCH] Revert "- fixed allocation size when constructing a string from a file system entry." This reverts commit 513d8cea8ddbd62cdd17e017403e07052a8ac021. This change broke voxel loading and possibly other things as well --- src/common/filesystem/filesystem.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/common/filesystem/filesystem.cpp b/src/common/filesystem/filesystem.cpp index 50f3fcdbb..5af6215fb 100644 --- a/src/common/filesystem/filesystem.cpp +++ b/src/common/filesystem/filesystem.cpp @@ -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)); } }