]> git.saurik.com Git - wxWidgets.git/commitdiff
length passed to WideCharToMultiByte() was off by one in the last commit
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 5 Feb 2008 07:24:59 +0000 (07:24 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 5 Feb 2008 07:24:59 +0000 (07:24 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51557 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/ole/oleutils.cpp

index e23617df25e3cbabc0fc69aeb74839e4ef6e2054..59f387426c88a9f981723a2f2d61246220d0b669 100644 (file)
@@ -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();