Commit fcdd0d30 authored by Andrew Nguyen's avatar Andrew Nguyen Committed by Alexandre Julliard

kernel32: Consistify allocation behavior with FormatMessageA/W.

parent 8e203225
......@@ -752,8 +752,7 @@ DWORD WINAPI FormatMessageW(
TRACE("-- %s\n",debugstr_w(target));
if (dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER) {
/* nSize is the MINIMUM size */
DWORD len = strlenW(target) + 1;
*((LPVOID*)lpBuffer) = LocalAlloc(LMEM_ZEROINIT,len*sizeof(WCHAR));
*((LPVOID*)lpBuffer) = LocalAlloc(LMEM_ZEROINIT, max(nSize, talloced)*sizeof(WCHAR));
strcpyW(*(LPWSTR*)lpBuffer, target);
}
else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment