]> git.saurik.com Git - wxWidgets.git/commitdiff
really pass the proper output buffer size in wxMBConv_win32 round trip check, at...
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 31 Mar 2006 17:40:17 +0000 (17:40 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 31 Mar 2006 17:40:17 +0000 (17:40 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38474 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/strconv.cpp

index cc851b8ff3cd12ac7ca34cd2ecb6e74a81835cea..ccffb2594bc5f1f5c391c6443d635cd9550a7a15 100644 (file)
@@ -1694,7 +1694,8 @@ public:
         // check if we succeeded, by doing a double trip:
         if ( !flags && buf )
         {
-            wxCharBuffer mbBuf(n);
+            const size_t mbLen = strlen(psz);
+            wxCharBuffer mbBuf(mbLen);
             if ( ::WideCharToMultiByte
                    (
                       m_CodePage,
@@ -1702,7 +1703,7 @@ public:
                       buf,
                       -1,
                       mbBuf.data(),
-                      n + 1,        // size in bytes, not length
+                      mbLen + 1,        // size in bytes, not length
                       NULL,
                       NULL
                    ) == 0 ||