Commit 5a4f3b47 authored by Francois Gouget's avatar Francois Gouget Committed by Alexandre Julliard

kernel32: There is no need to zero-fill the FormatMessage() temporary buffer.

parent bca6e18d
...@@ -272,7 +272,7 @@ static void format_add_char(struct _format_message_data *fmd, WCHAR c) ...@@ -272,7 +272,7 @@ static void format_add_char(struct _format_message_data *fmd, WCHAR c)
{ {
*fmd->t++ = c; *fmd->t++ = c;
if ((DWORD)(fmd->t - fmd->formatted) == fmd->size) { if ((DWORD)(fmd->t - fmd->formatted) == fmd->size) {
fmd->formatted = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, fmd->formatted, (fmd->size * 2) * sizeof(WCHAR)); fmd->formatted = HeapReAlloc(GetProcessHeap(), 0, fmd->formatted, (fmd->size * 2) * sizeof(WCHAR));
fmd->t = fmd->formatted + fmd->size; fmd->t = fmd->formatted + fmd->size;
fmd->size *= 2; fmd->size *= 2;
} }
...@@ -290,7 +290,7 @@ static LPWSTR format_message( BOOL unicode_caller, DWORD dwFlags, LPCWSTR fmtstr ...@@ -290,7 +290,7 @@ static LPWSTR format_message( BOOL unicode_caller, DWORD dwFlags, LPCWSTR fmtstr
BOOL eos = FALSE; BOOL eos = FALSE;
fmd.size = 100; fmd.size = 100;
fmd.formatted = fmd.t = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, fmd.size * sizeof(WCHAR) ); fmd.formatted = fmd.t = HeapAlloc( GetProcessHeap(), 0, fmd.size * sizeof(WCHAR) );
f = fmtstr; f = fmtstr;
while (*f && !eos) { while (*f && !eos) {
......
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