diff --git a/src/vehicle_cmd.cpp b/src/vehicle_cmd.cpp --- a/src/vehicle_cmd.cpp +++ b/src/vehicle_cmd.cpp @@ -751,7 +751,7 @@ static void CloneVehicleName(const Vehic /* Check the name is unique. */ if (IsUniqueVehicleName(buf)) { - dst->name = strdup(buf); + dst->name = stredup(buf); break; } } @@ -1029,7 +1029,7 @@ CommandCost CmdRenameVehicle(TileIndex t if (flags & DC_EXEC) { free(v->name); - v->name = reset ? NULL : strdup(text); + v->name = reset ? NULL : stredup(text); InvalidateWindowClassesData(GetWindowClassForVehicleType(v->type), 1); MarkWholeScreenDirty(); }