]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/file.cpp
Fix crash when accessing clipboard before entering the main loop.
[wxWidgets.git] / src / common / file.cpp
index 1063e452936cb0572a86d8785f7745d5785f27ec..2b837569a2ed06b9106a2998f8746933f3a83670 100644 (file)
@@ -312,7 +312,12 @@ bool wxFile::Write(const wxString& s, const wxMBConv& conv)
   if ( !buf )
       return false;
 
-  const size_t size = strlen(buf); // FIXME: use buf.length() when available
+#if wxUSE_UNICODE
+  const size_t size = buf.length();
+#else
+  const size_t size = s.length();
+#endif
+
   return Write(buf, size) == size;
 }