X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c8ef3d5565e6f1c1a23baa3be7d6a7b42151c616..3aaaf1aaa0dfe514bd778bc11dfa96854952c246:/src/osx/core/strconv_cf.cpp

diff --git a/src/osx/core/strconv_cf.cpp b/src/osx/core/strconv_cf.cpp
index 0c2abfbcc8..78f6429c2c 100644
--- a/src/osx/core/strconv_cf.cpp
+++ b/src/osx/core/strconv_cf.cpp
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        src/mac/corefoundation/strconv.cpp
+// Name:        src/osx/corefoundation/strconv.cpp
 // Purpose:     Unicode conversion classes
 // Author:      David Elliott
 // Modified by:
@@ -85,7 +85,8 @@ WXDLLIMPEXP_BASE wxMBConv* new_wxMBConv_cf(wxFontEncoding encoding)
                                                 false //no BOM/external representation
                                                 ));
 
-        wxCHECK(theString != NULL, wxCONV_FAILED);
+        if ( theString == NULL )
+            return wxCONV_FAILED;
 
         /* NOTE: The string content includes the NULL element if the source string did
          * That means we have to do nothing special because the destination will have
@@ -114,8 +115,7 @@ WXDLLIMPEXP_BASE wxMBConv* new_wxMBConv_cf(wxFontEncoding encoding)
                     dstSize * sizeof(wchar_t),
                     &usedBufLen);
 
-            // charsConverted is > 0 iff conversion succeeded
-            if(charsConverted <= 0)
+            if(charsConverted < CFStringGetLength(theString))
                 return wxCONV_FAILED;
 
             /* usedBufLen is the number of bytes written, so we divide by
@@ -216,8 +216,7 @@ WXDLLIMPEXP_BASE wxMBConv* new_wxMBConv_cf(wxFontEncoding encoding)
                 &usedBufLen
             );
 
-        // charsConverted is > 0 iff conversion succeeded
-        if(charsConverted <= 0)
+        if(charsConverted < CFStringGetLength(theString) )
             return wxCONV_FAILED;
 
         return usedBufLen;