summaryrefslogtreecommitdiff
path: root/src/waypoint.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-08-13 06:22:04 +0000
committerrubidium <rubidium@openttd.org>2008-08-13 06:22:04 +0000
commit8dffbcfd26e4238285ac6d07090976eb125b48da (patch)
tree4d5843494903387aa4370746ec69c55363be9a66 /src/waypoint.cpp
parentc816cc37fd01eb9b0842fd22cf5e79473d338c9f (diff)
downloadopenttd-8dffbcfd26e4238285ac6d07090976eb125b48da.tar.xz
(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.
Diffstat (limited to 'src/waypoint.cpp')
-rw-r--r--src/waypoint.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/waypoint.cpp b/src/waypoint.cpp
index ac81cc45d..1518176a7 100644
--- a/src/waypoint.cpp
+++ b/src/waypoint.cpp
@@ -389,6 +389,7 @@ CommandCost CmdRenameWaypoint(TileIndex tile, uint32 flags, uint32 p1, uint32 p2
if (!CheckTileOwnership(wp->xy)) return CMD_ERROR;
if (!StrEmpty(_cmd_text)) {
+ if (strlen(_cmd_text) >= MAX_LENGTH_WAYPOINT_NAME_BYTES) return CMD_ERROR;
if (!IsUniqueWaypointName(_cmd_text)) return_cmd_error(STR_NAME_MUST_BE_UNIQUE);
if (flags & DC_EXEC) {