X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/00ceccee892e0c06aac78a86b077241d694f82ef..e1673e527f08395de6864b09540162ca409a3c28:/src/common/strconv.cpp diff --git a/src/common/strconv.cpp b/src/common/strconv.cpp index f4731ceabe..3e354f466b 100644 --- a/src/common/strconv.cpp +++ b/src/common/strconv.cpp @@ -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