Allow removing things from this config. Still a ridiculously inefficient solution, of course.

This commit is contained in:
Alcaro
2016-05-01 17:02:57 +02:00
parent 7d54b5f271
commit 988561e2cc
4 changed files with 11 additions and 8 deletions

View File

@@ -251,7 +251,7 @@ void config::set(LPCWSTR name, LPCWSTR value)
if (!wcscmp(name, this->names[i]))
{
free(this->values[i]);
this->values[i] = wcsdup(value);
this->values[i] = (value!=NULL ? wcsdup(value) : NULL);
return;
}
}
@@ -292,7 +292,10 @@ LPWSTR config::flatten()
at += wsprintf(at, "%s", header);
for (size_t i=0;i<this->numentries;i++)
{
at += wsprintf(at, "%s=%s\n", this->names[i], this->values[i]);
if (this->values[i]!=NULL)
{
at += wsprintf(at, "%s=%s\n", this->names[i], this->values[i]);
}
}
return ret;