summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Lutz <michi@icosahedron.de>2018-06-03 15:47:15 +0200
committerMichael Lutz <michi@icosahedron.de>2018-06-03 22:36:27 +0200
commitb91e85003eb56e626e0b3713ef6711d77ee2906b (patch)
tree3c644407aad52d286541254a3e3daf8188feade4
parentd86416af7a884f562bf60fc2c6bef7af1c2f0ab0 (diff)
downloadopenttd-b91e85003eb56e626e0b3713ef6711d77ee2906b.tar.xz
Fix: Theoretical string overflow when building the cargo acceptance list for the land info window.
-rw-r--r--src/misc_gui.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp
index 01e8d2c45..5252832b5 100644
--- a/src/misc_gui.cpp
+++ b/src/misc_gui.cpp
@@ -313,10 +313,7 @@ public:
for (CargoID i = 0; i < NUM_CARGO; ++i) {
if (acceptance[i] > 0) {
/* Add a comma between each item. */
- if (found) {
- *strp++ = ',';
- *strp++ = ' ';
- }
+ if (found) strp = strecpy(strp, ", ", lastof(this->landinfo_data[LAND_INFO_MULTICENTER_LINE]));
found = true;
/* If the accepted value is less than 8, show it in 1/8:ths */