]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/corefoundation/cfstring.cpp
Fixes and XCode 2.3 update
[wxWidgets.git] / src / mac / corefoundation / cfstring.cpp
index 11b0f6d4ffd5874751a057f1c72390187bd78d81..078df1e308da30b4ccc9c1ffe0eaaa4dc91377b0 100644 (file)
@@ -681,8 +681,10 @@ wxString wxMacCFStringHolder::AsString(wxFontEncoding encoding)
     unibuf[cflen] = 0 ;
     wxMBConvUTF16 converter ;
     noChars = converter.MB2WC( NULL , (const char*)unibuf , 0 ) ;
+    wxASSERT_MSG( noChars != wxCONV_FAILED, _T("Unable to count the number of characters in this string!") );
     buf = new wxChar[ noChars + 1 ] ;
-    converter.MB2WC( buf , (const char*)unibuf , noChars ) ;
+    noChars = converter.MB2WC( buf , (const char*)unibuf , noChars + 1 ) ;
+    wxASSERT_MSG( noChars != wxCONV_FAILED, _T("Conversion of string failed!") );
     delete[] unibuf ;
 #endif
 #else