fix dangling pointer?

fixes the warning: "clang-diagnostic-dangling-gls: object backing the pointer will be destroyed at the end of the full-expression"
This commit is contained in:
DanielSvoboda 2025-02-18 22:21:53 -03:00
parent cba79b8359
commit d80ae108d6

View File

@ -423,7 +423,8 @@ void PatchMemory(std::string modNameStr, std::string offsetStr, std::string valu
std::vector<u8> payload;
for (size_t i = 0; i < valueStr.length(); i += 2) {
const char* byteStr = valueStr.substr(i, 2).c_str();
std::string tempStr = valueStr.substr(i, 2);
const char* byteStr = tempStr.c_str();
char* endPtr;
unsigned int byteVal = std::strtoul(byteStr, &endPtr, 16);