Fix #9766: Don't write uninitialised data in config file
(cherry picked from commit 50304f7164d5c88a42dcc1d09648c3ec8b2faab5) Fixes: #344
This commit is contained in:

committed by
Jonathan G Rennison

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
|
void ManyOfManySettingDesc::FormatValue(char *buf, const char *last, const void *object) const
|
||||||
{
|
{
|
||||||
uint bitmask = (uint)this->Read(object);
|
uint bitmask = (uint)this->Read(object);
|
||||||
|
if (bitmask == 0) {
|
||||||
|
buf[0] = '\0';
|
||||||
|
return;
|
||||||
|
}
|
||||||
bool first = true;
|
bool first = true;
|
||||||
for (uint id : SetBitIterator(bitmask)) {
|
for (uint id : SetBitIterator(bitmask)) {
|
||||||
if (!first) buf = strecpy(buf, "|", last);
|
if (!first) buf = strecpy(buf, "|", last);
|
||||||
|
Reference in New Issue
Block a user