summaryrefslogtreecommitdiff
path: root/src/misc_cmd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-08-13 06:05:01 +0000
committerrubidium <rubidium@openttd.org>2008-08-13 06:05:01 +0000
commit97c184f8f8265cf59b24ab3081a032c7162afcb5 (patch)
treedd64aeafae6994a4ed4e2d23a71d62db7de1668f /src/misc_cmd.cpp
parent08e7da71f520649359bbe40656a7c93e6ac2e1b0 (diff)
downloadopenttd-97c184f8f8265cf59b24ab3081a032c7162afcb5.tar.xz
(svn r14063) -Codechange: replace some "magic" constants with enumified constants.
Diffstat (limited to 'src/misc_cmd.cpp')
-rw-r--r--src/misc_cmd.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/misc_cmd.cpp b/src/misc_cmd.cpp
index 847200c49..00169e034 100644
--- a/src/misc_cmd.cpp
+++ b/src/misc_cmd.cpp
@@ -224,7 +224,7 @@ static bool IsUniqueCompanyName(const char *name)
*/
CommandCost CmdChangeCompanyName(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
{
- if (StrEmpty(_cmd_text) || strlen(_cmd_text) > MAX_LENGTH_COMPANY_NAME) return CMD_ERROR;
+ if (StrEmpty(_cmd_text) || strlen(_cmd_text) >= MAX_LENGTH_COMPANY_NAME_BYTES) return CMD_ERROR;
if (!IsUniqueCompanyName(_cmd_text)) return_cmd_error(STR_NAME_MUST_BE_UNIQUE);
@@ -260,7 +260,7 @@ static bool IsUniquePresidentName(const char *name)
*/
CommandCost CmdChangePresidentName(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
{
- if (StrEmpty(_cmd_text) || strlen(_cmd_text) > MAX_LENGTH_PRESIDENT_NAME) return CMD_ERROR;
+ if (StrEmpty(_cmd_text) || strlen(_cmd_text) >= MAX_LENGTH_PRESIDENT_NAME_BYTES) return CMD_ERROR;
if (!IsUniquePresidentName(_cmd_text)) return_cmd_error(STR_NAME_MUST_BE_UNIQUE);