really pass the proper output buffer size in wxMBConv_win32 round trip check, at least for the encodings without NULs such as UTF7

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38474 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2006-03-31 17:40:17 +00:00
parent 2f96d9bb8d
commit 53c174fcd5

View File

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