1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-29 17:39:09 +00:00

Fix: Theoretical string overflow when building the cargo acceptance list for the land info window.

This commit is contained in:
Michael Lutz
2018-06-03 15:47:15 +02:00
parent d86416af7a
commit b91e85003e

View File

@@ -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 */