fixed ReadString for wxUSE_UNICODE
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5527 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
8211bdcc03
commit
2ae47e3f2b
@ -86,13 +86,21 @@ double wxDataInputStream::ReadDouble()
|
||||
|
||||
wxString wxDataInputStream::ReadString()
|
||||
{
|
||||
wxString s;
|
||||
size_t len;
|
||||
|
||||
len = Read32();
|
||||
|
||||
#if wxUSE_UNICODE
|
||||
char *tmp = new char[len + 1];
|
||||
m_input->Read(tmp, len);
|
||||
tmp[len] = 0;
|
||||
wxString s(tmp);
|
||||
delete[] tmp;
|
||||
#else
|
||||
wxString s;
|
||||
m_input->Read(s.GetWriteBuf(len), len);
|
||||
s.UngetWriteBuf();
|
||||
#endif
|
||||
|
||||
return s;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user