[PATCH 1/2] reg/tests: Pass MultiByteToWideChar() the buffer size in characters

Hugh McMaster hugh.mcmaster at outlook.com
Wed Aug 23 07:31:47 CDT 2017


Signed-off-by: Hugh McMaster <hugh.mcmaster at outlook.com>
---
 programs/reg/tests/reg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/programs/reg/tests/reg.c b/programs/reg/tests/reg.c
index b042614f49..0a2fdbf977 100644
--- a/programs/reg/tests/reg.c
+++ b/programs/reg/tests/reg.c
@@ -766,7 +766,7 @@ static BOOL test_import_wstr_(unsigned line, const char *file_contents, DWORD *r
     memsize = len * sizeof(WCHAR);
     wstr = HeapAlloc(GetProcessHeap(), 0, memsize);
     if (!wstr) return FALSE;
-    MultiByteToWideChar(CP_UTF8, 0, file_contents, lenA, wstr, memsize);
+    MultiByteToWideChar(CP_UTF8, 0, file_contents, lenA, wstr, len);
 
     regfile = CreateFileA("test.reg", GENERIC_WRITE, 0, NULL, CREATE_ALWAYS,
                           FILE_ATTRIBUTE_NORMAL, NULL);
-- 
2.14.1




More information about the wine-patches mailing list