]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/wxchar.cpp
Restore compilation with --enable-stl, fix SetFocus with the generic control, and...
[wxWidgets.git] / src / common / wxchar.cpp
index f79bd0cbb86b4e8cb52cc6187b88044d886ee01e..962a705dcda45b434e9bb74916a71b8416d1e039 100644 (file)
@@ -1222,9 +1222,13 @@ int WXDLLEXPORT wxSnprintf_(wxChar *buf, size_t len, const wxChar *format, ...)
 #ifdef wxNEED_FPUTS
 int wxFputs(const wchar_t *ws, FILE *stream)
 {
+    wxCharBuffer buf(wxConvLibc.cWC2MB(ws));
+    if ( !buf )
+        return -1;
+
     // counting the number of wide characters written isn't worth the trouble,
     // simply distinguish between ok and error
-    return fputs(wxConvLibc.cWC2MB(ws), stream) == -1 ? -1 : 0;
+    return fputs(buf, stream) == -1 ? -1 : 0;
 }
 #endif // wxNEED_FPUTS