From 6e69b943d685c3b485d415d4fce53af28f0eba85 Mon Sep 17 00:00:00 2001 From: rubidium Date: Sun, 5 Dec 2010 22:25:08 +0000 Subject: (svn r21413) -Codechange: limit sign name by amount of characters, not bytes --- src/ai/api/ai_sign.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/ai/api/ai_sign.cpp') diff --git a/src/ai/api/ai_sign.cpp b/src/ai/api/ai_sign.cpp index ce36b1848..df16af0b7 100644 --- a/src/ai/api/ai_sign.cpp +++ b/src/ai/api/ai_sign.cpp @@ -30,7 +30,7 @@ { EnforcePrecondition(false, IsValidSign(sign_id)); EnforcePrecondition(false, !::StrEmpty(name)); - EnforcePreconditionCustomError(false, ::strlen(name) < MAX_LENGTH_SIGN_NAME_BYTES, AIError::ERR_PRECONDITION_STRING_TOO_LONG); + EnforcePreconditionCustomError(false, ::Utf8StringLength(name) < MAX_LENGTH_SIGN_NAME_CHARS, AIError::ERR_PRECONDITION_STRING_TOO_LONG); return AIObject::DoCommand(0, sign_id, 0, CMD_RENAME_SIGN, name); } @@ -66,7 +66,7 @@ { EnforcePrecondition(INVALID_SIGN, ::IsValidTile(location)); EnforcePrecondition(INVALID_SIGN, !::StrEmpty(text)); - EnforcePreconditionCustomError(false, ::strlen(text) < MAX_LENGTH_SIGN_NAME_BYTES, AIError::ERR_PRECONDITION_STRING_TOO_LONG); + EnforcePreconditionCustomError(false, ::Utf8StringLength(text) < MAX_LENGTH_SIGN_NAME_CHARS, AIError::ERR_PRECONDITION_STRING_TOO_LONG); if (!AIObject::DoCommand(location, 0, 0, CMD_PLACE_SIGN, text, &AIInstance::DoCommandReturnSignID)) return INVALID_SIGN; -- cgit v1.2.3-54-g00ecf