]> 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 da63e4ba0c4a068e463b07301e5d57f765b5be19..962a705dcda45b434e9bb74916a71b8416d1e039 100644 (file)
@@ -624,7 +624,7 @@ void wxPrintfConvSpec::ReplaceAsteriskWith(int width)
 
     // find the first * in our flag buffer
     char *pwidth = strchr(m_szFlags, '*');
-    wxASSERT(pwidth);
+    wxCHECK_RET(pwidth, _T("field width must be specified"));
 
     // save what follows the * (the +1 is to skip the asterisk itself!)
     strcpy(temp, pwidth+1);
@@ -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