Clear string in wxJSON::DecodeString() to avoid unintentional appending
This commit is contained in:
@@ -22,6 +22,7 @@ bool DecodeString(const wxString& in, wxString* out)
|
|||||||
// String has to chart with a quote
|
// String has to chart with a quote
|
||||||
if (*(ch++) != '"')
|
if (*(ch++) != '"')
|
||||||
return false;
|
return false;
|
||||||
|
out->clear();
|
||||||
out->reserve(buf.length());
|
out->reserve(buf.length());
|
||||||
const wchar_t* end = buf.data() + buf.length() - 1;
|
const wchar_t* end = buf.data() + buf.length() - 1;
|
||||||
for (; ch < end; ++ch)
|
for (; ch < end; ++ch)
|
||||||
|
Reference in New Issue
Block a user