mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-09 19:10:38 +00:00
Fix #9766: Don't write uninitialised data in config file
(cherry picked from commit 50304f7164d5c88a42dcc1d09648c3ec8b2faab5) Fixes: #344
This commit is contained in:
parent
dda4167edc
commit
3069f805e2
@ -386,6 +386,10 @@ void OneOfManySettingDesc::FormatValue(char *buf, const char *last, const void *
|
||||
void ManyOfManySettingDesc::FormatValue(char *buf, const char *last, const void *object) const
|
||||
{
|
||||
uint bitmask = (uint)this->Read(object);
|
||||
if (bitmask == 0) {
|
||||
buf[0] = '\0';
|
||||
return;
|
||||
}
|
||||
bool first = true;
|
||||
for (uint id : SetBitIterator(bitmask)) {
|
||||
if (!first) buf = strecpy(buf, "|", last);
|
||||
|
Loading…
Reference in New Issue
Block a user