From: Stefan Csomor Date: Wed, 15 Apr 2009 20:16:12 +0000 (+0000) Subject: make sure we treat partial conversions as failed X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/8d462eb74a32a522427e658441d1bc5e67b2d8a5 make sure we treat partial conversions as failed git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60175 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/osx/core/strconv_cf.cpp b/src/osx/core/strconv_cf.cpp index b4cde0c351..78f6429c2c 100644 --- a/src/osx/core/strconv_cf.cpp +++ b/src/osx/core/strconv_cf.cpp @@ -115,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 @@ -217,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;