Fix #9766: Don't write uninitialised data in config file

(cherry picked from commit 50304f7164d5c88a42dcc1d09648c3ec8b2faab5)

Fixes: #344
This commit is contained in:
glx22 2021-12-24 01:30:53 +01:00 committed by Jonathan G Rennison
parent dda4167edc
commit 3069f805e2

View File

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