Francois Gouget : kernel32: There is no need to zero-fill the FormatMessage () temporary buffer.
Alexandre Julliard
julliard at winehq.org
Thu Sep 20 15:05:36 CDT 2012
Module: wine
Branch: master
Commit: 5a4f3b478cfc6f91225ecfcfe4294df2e14b9b99
URL: http://source.winehq.org/git/wine.git/?a=commit;h=5a4f3b478cfc6f91225ecfcfe4294df2e14b9b99
Author: Francois Gouget <fgouget at free.fr>
Date: Wed Sep 19 20:37:38 2012 +0200
kernel32: There is no need to zero-fill the FormatMessage() temporary buffer.
---
dlls/kernel32/format_msg.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/kernel32/format_msg.c b/dlls/kernel32/format_msg.c
index a3cbab9..101c2fa 100644
--- a/dlls/kernel32/format_msg.c
+++ b/dlls/kernel32/format_msg.c
@@ -272,7 +272,7 @@ static void format_add_char(struct _format_message_data *fmd, WCHAR c)
{
*fmd->t++ = c;
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->size *= 2;
}
@@ -290,7 +290,7 @@ static LPWSTR format_message( BOOL unicode_caller, DWORD dwFlags, LPCWSTR fmtstr
BOOL eos = FALSE;
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;
while (*f && !eos) {
More information about the wine-cvs
mailing list