Codechange: do not make a string valid in place, to then copy it

This commit is contained in:
Rubidium
2023-07-05 19:36:35 +02:00
committed by rubidium42
parent b958a343fe
commit 18a31cca7c
3 changed files with 5 additions and 10 deletions

View File

@@ -573,8 +573,7 @@ bool ScriptInstance::IsPaused()
SlObject(nullptr, _script_byte);
static char buf[std::numeric_limits<decltype(_script_sl_byte)>::max()];
SlCopy(buf, _script_sl_byte, SLE_CHAR);
StrMakeValidInPlace(buf, buf + _script_sl_byte);
if (data != nullptr) data->push_back(std::string(buf));
if (data != nullptr) data->push_back(StrMakeValid(std::string_view(buf, _script_sl_byte)));
return true;
}