(svn r14064) -Fix [FS#1752]: check for the length of strings (in bytes) in the command. Checking for the length in pixels is impossible because that differs per client.

This commit is contained in:
rubidium
2008-08-13 06:22:04 +00:00
parent 97c184f8f8
commit 2d94337e1a
8 changed files with 16 additions and 8 deletions

View File

@@ -170,7 +170,8 @@ static bool IsUniqueGroupName(const char *name)
*/
CommandCost CmdRenameGroup(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
{
if (!IsValidGroupID(p1) || StrEmpty(_cmd_text)) return CMD_ERROR;
if (!IsValidGroupID(p1)) return CMD_ERROR;
if (StrEmpty(_cmd_text) || strlen(_cmd_text) >= MAX_LENGTH_GROUP_NAME_BYTES) return CMD_ERROR;
Group *g = GetGroup(p1);
if (g->owner != _current_player) return CMD_ERROR;