diff options
author | rubidium <rubidium@openttd.org> | 2013-02-08 20:34:27 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2013-02-08 20:34:27 +0000 |
commit | 4e61c1770dc584229afdca7a37ce82dbf121b9d4 (patch) | |
tree | a37ac382e65ac4a0db3440365b8a461387edd65e /src/script/api/script_sign.cpp | |
parent | bb225ae39e93dabda532ee449c18b49de98b00af (diff) | |
download | openttd-4e61c1770dc584229afdca7a37ce82dbf121b9d4.tar.xz |
(svn r24982) -Fix [FS#5465]: [Script] Crash when passing too many parameters
Diffstat (limited to 'src/script/api/script_sign.cpp')
-rw-r--r-- | src/script/api/script_sign.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/script/api/script_sign.cpp b/src/script/api/script_sign.cpp index ecf0b4c28..514dd4a21 100644 --- a/src/script/api/script_sign.cpp +++ b/src/script/api/script_sign.cpp @@ -38,7 +38,7 @@ EnforcePrecondition(false, IsValidSign(sign_id)); EnforcePrecondition(false, name != NULL); const char *text = name->GetEncodedText(); - EnforcePrecondition(false, !::StrEmpty(text)); + EnforcePreconditionEncodedText(false, text); EnforcePreconditionCustomError(false, ::Utf8StringLength(text) < MAX_LENGTH_SIGN_NAME_CHARS, ScriptError::ERR_PRECONDITION_STRING_TOO_LONG); return ScriptObject::DoCommand(0, sign_id, 0, CMD_RENAME_SIGN, text); @@ -73,7 +73,7 @@ EnforcePrecondition(INVALID_SIGN, ::IsValidTile(location)); EnforcePrecondition(INVALID_SIGN, name != NULL); const char *text = name->GetEncodedText(); - EnforcePrecondition(INVALID_SIGN, !::StrEmpty(text)); + EnforcePreconditionEncodedText(INVALID_SIGN, text); EnforcePreconditionCustomError(INVALID_SIGN, ::Utf8StringLength(text) < MAX_LENGTH_SIGN_NAME_CHARS, ScriptError::ERR_PRECONDITION_STRING_TOO_LONG); if (!ScriptObject::DoCommand(location, 0, 0, CMD_PLACE_SIGN, text, &ScriptInstance::DoCommandReturnSignID)) return INVALID_SIGN; |