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
This commit is contained in:
Stefan Csomor 2009-04-15 20:16:12 +00:00
parent f2c1b903bf
commit 8d462eb74a

View File

@ -115,8 +115,7 @@ WXDLLIMPEXP_BASE wxMBConv* new_wxMBConv_cf(wxFontEncoding encoding)
dstSize * sizeof(wchar_t), dstSize * sizeof(wchar_t),
&usedBufLen); &usedBufLen);
// charsConverted is > 0 iff conversion succeeded if(charsConverted < CFStringGetLength(theString))
if(charsConverted <= 0)
return wxCONV_FAILED; return wxCONV_FAILED;
/* usedBufLen is the number of bytes written, so we divide by /* usedBufLen is the number of bytes written, so we divide by
@ -217,8 +216,7 @@ WXDLLIMPEXP_BASE wxMBConv* new_wxMBConv_cf(wxFontEncoding encoding)
&usedBufLen &usedBufLen
); );
// charsConverted is > 0 iff conversion succeeded if(charsConverted < CFStringGetLength(theString) )
if(charsConverted <= 0)
return wxCONV_FAILED; return wxCONV_FAILED;
return usedBufLen; return usedBufLen;