1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-24 06:59:10 +00:00

Fix 65cbde4b: Writing to uninitialized string when loading a currency NewGRF.

This commit is contained in:
Michael Lutz
2021-11-06 18:50:28 +01:00
parent 6ff0858b38
commit 95c8467670

View File

@@ -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);