]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/sstream.cpp
warning fix - only use the function in debug mode
[wxWidgets.git] / src / common / sstream.cpp
index de3496327e3192dad12f5297fd1c1e24a20d547b..1a87534dc31c7be7571e061c206a0556d995e0ec 100644 (file)
@@ -101,6 +101,15 @@ size_t wxStringInputStream::OnSysRead(void *buffer, size_t size)
 // wxStringOutputStream implementation
 // ============================================================================
 
+// ----------------------------------------------------------------------------
+// seek/tell
+// ----------------------------------------------------------------------------
+
+off_t wxStringOutputStream::OnSysTell() const
+{
+    return wx_static_cast(off_t, m_pos);
+}
+
 // ----------------------------------------------------------------------------
 // actual IO
 // ----------------------------------------------------------------------------
@@ -112,10 +121,13 @@ size_t wxStringOutputStream::OnSysWrite(const void *buffer, size_t size)
 
     const wxChar *p = wx_static_cast(const wxChar *, buffer);
 
-    m_str->Append(wxString(p, p + len + 1));
+    m_str->Append(wxString(p, p + len));
 
     // return number of bytes actually written
-    return len*sizeof(wxChar);
+    len *= sizeof(wxChar);
+    m_pos += len;
+
+    return len;
 }
 
 #endif // wxUSE_STREAMS