Module: wine Branch: master Commit: 8e6e015eb5d1f8701e9bf03574b4c0890b1c89ac URL: http://source.winehq.org/git/wine.git/?a=commit;h=8e6e015eb5d1f8701e9bf03574...
Author: Alexandre Julliard julliard@winehq.org Date: Thu May 21 13:31:01 2009 +0200
kernel32: Add missing terminator on %wc format conversion.
---
dlls/kernel32/format_msg.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/dlls/kernel32/format_msg.c b/dlls/kernel32/format_msg.c index 1fca102..f4baaae 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 {