summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Lutz <michi@icosahedron.de>2021-11-06 18:50:28 +0100
committerMichael Lutz <michi@icosahedron.de>2021-11-06 19:15:29 +0100
commit95c84676701ba8e6b4ec6b84ce588b653b3a2ac9 (patch)
treebe09a88fad7898546b57fdf048cd035a5c6c8084
parent6ff0858b38cac1fa734081adef1ae6d6b6297a13 (diff)
downloadopenttd-95c84676701ba8e6b4ec6b84ce588b653b3a2ac9.tar.xz
Fix 65cbde4b: Writing to uninitialized string when loading a currency NewGRF.
-rw-r--r--src/newgrf.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/newgrf.cpp b/src/newgrf.cpp
index 8a88e5203..d1352d02e 100644
--- a/src/newgrf.cpp
+++ b/src/newgrf.cpp
@@ -2679,8 +2679,8 @@ static ChangeInfoResult GlobalVarChangeInfo(uint gvid, int numinfo, int prop, By
uint16 options = buf->ReadWord();
if (curidx < CURRENCY_END) {
- _currency_specs[curidx].separator[0] = GB(options, 0, 8);
- _currency_specs[curidx].separator[1] = '\0';
+ _currency_specs[curidx].separator.clear();
+ _currency_specs[curidx].separator.push_back(GB(options, 0, 8));
/* By specifying only one bit, we prevent errors,
* since newgrf specs said that only 0 and 1 can be set for symbol_pos */
_currency_specs[curidx].symbol_pos = GB(options, 8, 1);