]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/datstrm.cpp
several mingw32 compilation fixes
[wxWidgets.git] / src / common / datstrm.cpp
index 433c90472a6c593dc8a10e8290d6d0efa52ed888..5c4fd46091807f4a169209053ec3579403eb6091 100644 (file)
@@ -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;
 }