X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/13111b2ac81e694d6b69822dff61838ae66052b2..4004f41e3ce1655f9fa05c55a697ac0f8677c23a:/src/common/datstrm.cpp diff --git a/src/common/datstrm.cpp b/src/common/datstrm.cpp index 433c90472a..5c4fd46091 100644 --- a/src/common/datstrm.cpp +++ b/src/common/datstrm.cpp @@ -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; }