mshtml: Pass buffer length to MultiByteToWideChar instead of -1.
authorJacek Caban <jacek@codeweavers.com>
Wed, 26 Mar 2008 14:24:20 +0000 (15:24 +0100)
committerAlexandre Julliard <julliard@winehq.org>
Wed, 26 Mar 2008 22:38:36 +0000 (23:38 +0100)
dlls/mshtml/mshtml_private.h

index 151d266f4b920349092723add9dc9d3830f03123..6d44f32d7b523fb181d0a89984001c0beb1a49db 100644 (file)
@@ -592,7 +592,7 @@ static inline WCHAR *heap_strdupAtoW(const char *str)
 
         len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
         ret = heap_alloc(len*sizeof(WCHAR));
-        MultiByteToWideChar(CP_ACP, 0, str, -1, ret, -1);
+        MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len);
     }
 
     return ret;