From: Vadim Zeitlin Date: Fri, 31 Mar 2006 20:28:37 +0000 (+0000) Subject: undid last (wrong) change to wxMBConvUTF16swap::MB2WC(); added comment to explain why X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/da12017a6487215a0e9673be50a135970c8d5997 undid last (wrong) change to wxMBConvUTF16swap::MB2WC(); added comment to explain why git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38489 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/strconv.cpp b/src/common/strconv.cpp index 778d8dbb05..9d8481349f 100644 --- a/src/common/strconv.cpp +++ b/src/common/strconv.cpp @@ -864,7 +864,9 @@ size_t wxMBConvUTF16swap::MB2WC(wchar_t *buf, const char *psz, size_t n) const { size_t len = 0; - while ( *psz && (!buf || len < n) ) + // UTF16 string must be terminated by 2 NULs as single NULs may occur + // inside the string + while ( (psz[0] || psz[1]) && (!buf || len < n) ) { if ( buf ) {