--- a/src/misc_cmd.cpp Tue Jul 15 23:27:28 2008 +0000
+++ b/src/misc_cmd.cpp Thu Jul 17 11:19:20 2008 +0000
@@ -225,7 +225,7 @@
*/
CommandCost CmdChangeCompanyName(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
{
- if (StrEmpty(_cmd_text)) return CMD_ERROR;
+ if (StrEmpty(_cmd_text) || strlen(_cmd_text) > MAX_LENGTH_COMPANY_NAME) return CMD_ERROR;
if (!IsUniqueCompanyName(_cmd_text)) return_cmd_error(STR_NAME_MUST_BE_UNIQUE);
@@ -262,7 +262,7 @@
*/
CommandCost CmdChangePresidentName(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
{
- if (StrEmpty(_cmd_text)) return CMD_ERROR;
+ if (StrEmpty(_cmd_text) || strlen(_cmd_text) > MAX_LENGTH_PRESIDENT_NAME) return CMD_ERROR;
if (!IsUniquePresidentName(_cmd_text)) return_cmd_error(STR_NAME_MUST_BE_UNIQUE);