Use correct length for the string returned from wxFile::ReadAll()

This corrects f75387850b and just uses the
newly added assign() overload taking the buffer directly: as the buffer
already knows its length, this makes it unnecessary to pass it
separately.

Closes #16490.
This commit is contained in:
Vadim Zeitlin
2017-12-06 03:40:02 +01:00
parent 140d6fea88
commit 436d27baf0

View File

@@ -281,8 +281,7 @@ bool wxFile::ReadAll(wxString *str, const wxMBConv& conv)
length -= nread;
}
wxString strTmp(buf, conv, length);
str->swap(strTmp);
str->assign(buf, conv);
return true;
}