forked from mirror/OpenTTD
(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:
@@ -2809,7 +2809,9 @@ static bool IsUniqueStationName(const char *name)
|
||||
*/
|
||||
CommandCost CmdRenameStation(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
|
||||
{
|
||||
if (!IsValidStationID(p1) || StrEmpty(_cmd_text)) return CMD_ERROR;
|
||||
if (!IsValidStationID(p1))
|
||||
if (StrEmpty(_cmd_text) || strlen(_cmd_text) >= MAX_LENGTH_STATION_NAME_BYTES) return CMD_ERROR;
|
||||
|
||||
Station *st = GetStation(p1);
|
||||
|
||||
if (!CheckOwnership(st->owner)) return CMD_ERROR;
|
||||
|
Reference in New Issue
Block a user