From 54adb9cbedb3a5e2c117c1cfc34059ae103f81eb Mon Sep 17 00:00:00 2001 From: jvoisin Date: Sun, 11 Apr 2021 18:57:47 +0200 Subject: [PATCH] Fix an off-by-one in loadscpt --- components/esm/loadscpt.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/esm/loadscpt.cpp b/components/esm/loadscpt.cpp index a7f348cb17..53b6aedd38 100644 --- a/components/esm/loadscpt.cpp +++ b/components/esm/loadscpt.cpp @@ -30,7 +30,7 @@ namespace ESM // The tmp buffer is a null-byte separated string list, we // just have to pick out one string at a time. char* str = tmp.data(); - if (!str) + if (tmp.empty()) { if (mVarNames.size() > 0) Log(Debug::Warning) << "SCVR with no variable names"; @@ -51,6 +51,7 @@ namespace ESM ss << "\n Subrecord: " << "SCVR"; ss << "\n Offset: 0x" << std::hex << esm.getFileOffset(); Log(Debug::Verbose) << ss.str(); + str = tmp.data(); } for (size_t i = 0; i < mVarNames.size(); i++)