Clear string in wxJSON::DecodeString() to avoid unintentional appending

This commit is contained in:
Tobias Taschner
2021-02-05 10:27:00 +01:00
parent 788bef2cf2
commit 2e94551f6f

View File

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