]> git.saurik.com Git - wxWidgets.git/commitdiff
undid last (wrong) change to wxMBConvUTF16swap::MB2WC(); added comment to explain why
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 31 Mar 2006 20:28:37 +0000 (20:28 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 31 Mar 2006 20:28:37 +0000 (20:28 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38489 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/strconv.cpp

index 778d8dbb05174f42f1c4a1c970900ebb8a6e7696..9d8481349fe497d54ab99c1cd36b12d22c2ae746 100644 (file)
@@ -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 )
         {