From cf61c2f11fbffe20749382feb8fe03d238a2888d Mon Sep 17 00:00:00 2001 From: rubidium Date: Sun, 5 Dec 2010 22:24:50 +0000 Subject: (svn r21412) -Codechange: limit company name by amount of characters, not bytes --- src/ai/api/ai_company.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ai') diff --git a/src/ai/api/ai_company.cpp b/src/ai/api/ai_company.cpp index e11b2bb4b..03a642609 100644 --- a/src/ai/api/ai_company.cpp +++ b/src/ai/api/ai_company.cpp @@ -38,7 +38,7 @@ /* static */ bool AICompany::SetName(const char *name) { EnforcePrecondition(false, !::StrEmpty(name)); - EnforcePreconditionCustomError(false, ::strlen(name) < MAX_LENGTH_COMPANY_NAME_BYTES, AIError::ERR_PRECONDITION_STRING_TOO_LONG); + EnforcePreconditionCustomError(false, ::Utf8StringLength(name) < MAX_LENGTH_COMPANY_NAME_CHARS, AIError::ERR_PRECONDITION_STRING_TOO_LONG); return AIObject::DoCommand(0, 0, 0, CMD_RENAME_COMPANY, name); } -- cgit v1.2.3-70-g09d2