]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/strconv.cpp
Corrected bug in in revision 47973
[wxWidgets.git] / src / common / strconv.cpp
index f4731ceabee2e5203f1c1c7b0f46d2647d63a1fc..3e354f466b668ab41e01c581f0bea6af1df5ac2a 100644 (file)
@@ -2457,8 +2457,10 @@ public:
                     return wxCONV_FAILED;
             }
 
+            if ( !n )
+                n = wcslen(pwz);
             wxWCharBuffer wcBuf(n);
-            if ( MB2WC(wcBuf.data(), buf, n) == wxCONV_FAILED ||
+            if ( MB2WC(wcBuf.data(), buf, n + 1) == wxCONV_FAILED ||
                     wcscmp(wcBuf, pwz) != 0 )
             {
                 // we didn't obtain the same thing we started from, hence