Hans Leidekker : winhttp: Pass correct buffer size to WideCharToMultiByte.

Alexandre Julliard julliard at winehq.org
Wed Nov 20 16:49:12 CST 2019


Module: wine
Branch: master
Commit: 5a212dff7dee325f10ec4e581f9b99935b955ec6
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=5a212dff7dee325f10ec4e581f9b99935b955ec6

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Wed Nov 20 14:29:07 2019 +0100

winhttp: Pass correct buffer size to WideCharToMultiByte.

Signed-off-by: Hans Leidekker <hans at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/winhttp/winhttp_private.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/winhttp/winhttp_private.h b/dlls/winhttp/winhttp_private.h
index 93cf0f7125..734a1ad52a 100644
--- a/dlls/winhttp/winhttp_private.h
+++ b/dlls/winhttp/winhttp_private.h
@@ -314,7 +314,7 @@ static inline WCHAR *strdupAW( const char *src )
     WCHAR *dst = NULL;
     if (src)
     {
-        DWORD len = MultiByteToWideChar( CP_ACP, 0, src, -1, NULL, 0 );
+        int len = MultiByteToWideChar( CP_ACP, 0, src, -1, NULL, 0 );
         if ((dst = heap_alloc( len * sizeof(WCHAR) )))
             MultiByteToWideChar( CP_ACP, 0, src, -1, dst, len );
     }
@@ -341,7 +341,7 @@ static inline char *strdupWA_sized( const WCHAR *src, DWORD size )
         int len = WideCharToMultiByte( CP_ACP, 0, src, size, NULL, 0, NULL, NULL ) + 1;
         if ((dst = heap_alloc( len )))
         {
-            WideCharToMultiByte( CP_ACP, 0, src, len, dst, size, NULL, NULL );
+            WideCharToMultiByte( CP_ACP, 0, src, size, dst, len, NULL, NULL );
             dst[len - 1] = 0;
         }
     }




More information about the wine-cvs mailing list