Marcus Meissner : atl: Fixed second buffer size to MultiByteToWideChar.

Alexandre Julliard julliard at winehq.org
Thu Feb 5 09:20:56 CST 2009


Module: wine
Branch: master
Commit: d65bd8ff24dc32e9fc8720ae57bc81a9b52a288f
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=d65bd8ff24dc32e9fc8720ae57bc81a9b52a288f

Author: Marcus Meissner <marcus at jet.franken.de>
Date:   Wed Feb  4 20:33:40 2009 +0100

atl: Fixed second buffer size to MultiByteToWideChar.

---

 dlls/atl/registrar.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/atl/registrar.c b/dlls/atl/registrar.c
index d3ca9b0..b2efda9 100644
--- a/dlls/atl/registrar.c
+++ b/dlls/atl/registrar.c
@@ -444,7 +444,7 @@ static HRESULT resource_register(Registrar *This, LPCOLESTR resFileName,
             if(regstra) {
                 len = MultiByteToWideChar(CP_ACP, 0, regstra, reslen, NULL, 0)+1;
                 regstrw = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len*sizeof(WCHAR));
-                MultiByteToWideChar(CP_ACP, 0, regstra, reslen, regstrw, -1);
+                MultiByteToWideChar(CP_ACP, 0, regstra, reslen, regstrw, len);
                 regstrw[len-1] = '\0';
 
                 hres = string_register(This, regstrw, do_register);
@@ -484,7 +484,7 @@ static HRESULT file_register(Registrar *This, LPCOLESTR fileName, BOOL do_regist
         if(lres == ERROR_SUCCESS) {
             len = MultiByteToWideChar(CP_ACP, 0, regstra, filelen, NULL, 0)+1;
             regstrw = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len*sizeof(WCHAR));
-            MultiByteToWideChar(CP_ACP, 0, regstra, filelen, regstrw, -1);
+            MultiByteToWideChar(CP_ACP, 0, regstra, filelen, regstrw, len);
             regstrw[len-1] = '\0';
             
             hres = string_register(This, regstrw, do_register);




More information about the wine-cvs mailing list