Codechange: [Script] Don't expose static buffers outside of ScriptText

This commit is contained in:
glx22
2023-02-16 02:05:54 +01:00
committed by Loïc Guilloux
parent e735370318
commit 3559576166
16 changed files with 60 additions and 76 deletions

View File

@@ -38,7 +38,7 @@
EnforcePrecondition(false, IsValidSign(sign_id));
EnforcePrecondition(false, name != nullptr);
const char *text = name->GetDecodedText();
const std::string &text = name->GetDecodedText();
EnforcePreconditionEncodedText(false, text);
EnforcePreconditionCustomError(false, ::Utf8StringLength(text) < MAX_LENGTH_SIGN_NAME_CHARS, ScriptError::ERR_PRECONDITION_STRING_TOO_LONG);
@@ -73,7 +73,7 @@
EnforcePrecondition(INVALID_SIGN, ::IsValidTile(location));
EnforcePrecondition(INVALID_SIGN, name != nullptr);
const char *text = name->GetDecodedText();
const std::string &text = name->GetDecodedText();
EnforcePreconditionEncodedText(INVALID_SIGN, text);
EnforcePreconditionCustomError(INVALID_SIGN, ::Utf8StringLength(text) < MAX_LENGTH_SIGN_NAME_CHARS, ScriptError::ERR_PRECONDITION_STRING_TOO_LONG);