]> git.saurik.com Git - wxWidgets.git/commitdiff
fix wxMBConv_iconv to respect the base class conventions: when the input is NUL-termi...
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 31 May 2008 01:39:32 +0000 (01:39 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 31 May 2008 01:39:32 +0000 (01:39 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53869 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/strconv.cpp

index ba9af8782cd6cc8a1a1253badf58a73214290fa8..5c239e2728200f05a541d5dee30614632b0c471d 100644 (file)
@@ -2082,6 +2082,11 @@ wxMBConv_iconv::ToWChar(wchar_t *dst, size_t dstLen,
                 srcLen = p - src;
                 break;
         }
                 srcLen = p - src;
                 break;
         }
+
+        // when we're determining the length of the string ourselves we count
+        // the terminating NUL(s) as part of it and always NUL-terminate the
+        // output
+        srcLen += nulLen;
     }
 
     // we express length in the number of (wide) characters but iconv always
     }
 
     // we express length in the number of (wide) characters but iconv always