From: Vadim Zeitlin Date: Tue, 5 Feb 2008 07:24:59 +0000 (+0000) Subject: length passed to WideCharToMultiByte() was off by one in the last commit X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/7b3575a98f2e9bffaa11a60b770accdf9c88df89?ds=inline length passed to WideCharToMultiByte() was off by one in the last commit git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51557 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/ole/oleutils.cpp b/src/msw/ole/oleutils.cpp index e23617df25..59f387426c 100644 --- a/src/msw/ole/oleutils.cpp +++ b/src/msw/ole/oleutils.cpp @@ -87,8 +87,8 @@ WXDLLEXPORT wxString wxConvertStringFromOle(BSTR bStr) #else wxString str; if ( !::WideCharToMultiByte(CP_ACP, 0 /* no flags */, - bStr, len + 1 /* include last NUL */, - wxStringBuffer(str, len), len, + bStr, len /* not necessary NUL-terminated */, + wxStringBuffer(str, len + 1), len + 1, NULL, NULL /* no default char */) ) { str.clear();