summaryrefslogtreecommitdiff
path: root/src/vehicle_cmd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-12-05 22:25:49 +0000
committerrubidium <rubidium@openttd.org>2010-12-05 22:25:49 +0000
commitea6803971879f9c35fd2695d3817b54b87fb6269 (patch)
tree4f18386494a5fc93a119ad76f9ed8d7d3ca71c15 /src/vehicle_cmd.cpp
parent44d1c5534757a284b528dfe30ba227675234b4e4 (diff)
downloadopenttd-ea6803971879f9c35fd2695d3817b54b87fb6269.tar.xz
(svn r21416) -Codechange: limit vehicle name by amount of characters, not bytes
Diffstat (limited to 'src/vehicle_cmd.cpp')
-rw-r--r--src/vehicle_cmd.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vehicle_cmd.cpp b/src/vehicle_cmd.cpp
index 4d29ac495..efb6d3b92 100644
--- a/src/vehicle_cmd.cpp
+++ b/src/vehicle_cmd.cpp
@@ -882,7 +882,7 @@ CommandCost CmdRenameVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uin
bool reset = StrEmpty(text);
if (!reset) {
- if (strlen(text) >= MAX_LENGTH_VEHICLE_NAME_BYTES) return CMD_ERROR;
+ if (Utf8StringLength(text) >= MAX_LENGTH_VEHICLE_NAME_CHARS) return CMD_ERROR;
if (!(flags & DC_AUTOREPLACE) && !IsUniqueVehicleName(text)) return_cmd_error(STR_ERROR_NAME_MUST_BE_UNIQUE);
}