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:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user