X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9d653e810c23660d41b1e9e6cfc64646d9ceef2d..9f7e7edb78aa19d6aed53b113aa953c24d6335b1:/src/common/strconv.cpp diff --git a/src/common/strconv.cpp b/src/common/strconv.cpp index 102f0d82db..507bf1307b 100644 --- a/src/common/strconv.cpp +++ b/src/common/strconv.cpp @@ -53,7 +53,7 @@ #include "wx/fontmap.h" #ifdef __DARWIN__ -#include "wx/mac/corefoundation/private/strconv_cf.h" +#include "wx/osx/core/private/strconv_cf.h" #endif //def __DARWIN__ @@ -987,7 +987,7 @@ wxMBConvStrictUTF8::FromWChar(char *dst, size_t dstLen, for ( const wchar_t *wp = src; ; wp++ ) { - if ( !(srcLen == wxNO_LEN ? *wp : srcLen--) ) + if ( !(srcLen == wxNO_LEN ? *wp : srcLen) ) { // all done successfully, just add the trailing NULL if we are not // using explicit length @@ -1007,6 +1007,8 @@ wxMBConvStrictUTF8::FromWChar(char *dst, size_t dstLen, return written; } + if ( srcLen != wxNO_LEN ) + srcLen--; wxUint32 code; #ifdef WC_UTF16