diff --git a/engine.c b/engine.c --- a/engine.c +++ b/engine.c @@ -887,7 +887,7 @@ int32 CmdRenameEngine(int x, int y, uint { StringID str; - if (!IsEngineIndex(p1)) return CMD_ERROR; + if (!IsEngineIndex(p1) || _cmd_text[0] == '\0') return CMD_ERROR; str = AllocateNameUnique(_cmd_text, 0); if (str == 0) return CMD_ERROR; diff --git a/misc_cmd.c b/misc_cmd.c --- a/misc_cmd.c +++ b/misc_cmd.c @@ -129,6 +129,8 @@ int32 CmdChangeCompanyName(int x, int y, StringID str; Player *p; + if (_cmd_text[0] == '\0') return CMD_ERROR; + str = AllocateNameUnique(_cmd_text, 4); if (str == 0) return CMD_ERROR; @@ -153,6 +155,8 @@ int32 CmdChangePresidentName(int x, int StringID str; Player *p; + if (_cmd_text[0] == '\0') return CMD_ERROR; + str = AllocateNameUnique(_cmd_text, 4); if (str == 0) return CMD_ERROR; diff --git a/station_cmd.c b/station_cmd.c --- a/station_cmd.c +++ b/station_cmd.c @@ -2653,7 +2653,7 @@ int32 CmdRenameStation(int x, int y, uin StringID str,old_str; Station *st; - if (!IsStationIndex(p1)) return CMD_ERROR; + if (!IsStationIndex(p1) || _cmd_text[0] == '\0') return CMD_ERROR; st = GetStation(p1); if (!IsValidStation(st) || !CheckOwnership(st->owner)) return CMD_ERROR; diff --git a/town_cmd.c b/town_cmd.c --- a/town_cmd.c +++ b/town_cmd.c @@ -1447,7 +1447,7 @@ int32 CmdRenameTown(int x, int y, uint32 StringID str; Town *t; - if (!IsTownIndex(p1)) return CMD_ERROR; + if (!IsTownIndex(p1) || _cmd_text[0] == '\0') return CMD_ERROR; t = GetTown(p1); diff --git a/vehicle.c b/vehicle.c --- a/vehicle.c +++ b/vehicle.c @@ -1654,7 +1654,7 @@ int32 CmdNameVehicle(int x, int y, uint3 Vehicle *v; StringID str; - if (!IsVehicleIndex(p1)) return CMD_ERROR; + if (!IsVehicleIndex(p1) || _cmd_text[0] == '\0') return CMD_ERROR; v = GetVehicle(p1);