From 8e6e015eb5d1f8701e9bf03574b4c0890b1c89ac Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Thu, 21 May 2009 13:31:01 +0200 Subject: [PATCH] kernel32: Add missing terminator on %wc format conversion. --- dlls/kernel32/format_msg.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/kernel32/format_msg.c b/dlls/kernel32/format_msg.c index 1fca102b322..f4baaaec81d 100644 --- a/dlls/kernel32/format_msg.c +++ b/dlls/kernel32/format_msg.c @@ -266,8 +266,9 @@ DWORD WINAPI FormatMessageA( else if (strcmp(fmtstr, "%wc") == 0) { sz = WideCharToMultiByte(CP_ACP, 0, (WCHAR *)argliststart, 1, NULL, 0, NULL, NULL); - b = HeapAlloc(GetProcessHeap(), 0, sz); + b = HeapAlloc(GetProcessHeap(), 0, sz + 1); WideCharToMultiByte(CP_ACP, 0, (WCHAR *)argliststart, 1, b, sz, NULL, NULL); + b[sz] = 0; } else {