Commit 1c66c611 authored by Alexandre Julliard's avatar Alexandre Julliard

kernel32: Don't use sizeof in traces to avoid printf format warnings.

parent bc99ac09
......@@ -138,6 +138,7 @@ DWORD WINAPI FormatMessageA(
va_list* _args )
{
LPDWORD args=(LPDWORD)_args;
DWORD ret = 0;
#if defined(__i386__) || defined(__sparc__)
/* This implementation is completely dependent on the format of the va_list on x86 CPUs */
LPSTR target,t;
......@@ -331,13 +332,10 @@ DWORD WINAPI FormatMessageA(
}
HeapFree(GetProcessHeap(),0,target);
HeapFree(GetProcessHeap(),0,from);
TRACE("-- returning %d\n", (dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER) ? strlen(*(LPSTR*)lpBuffer):strlen(lpBuffer));
return (dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER) ?
strlen(*(LPSTR*)lpBuffer):
strlen(lpBuffer);
#else
return 0;
ret = (dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER) ? strlen(*(LPSTR*)lpBuffer) : strlen(lpBuffer);
#endif /* __i386__ */
TRACE("-- returning %ld\n", ret);
return ret;
}
#undef ADD_TO_T
......
......@@ -501,7 +501,7 @@ static BOOL module_nextW( HANDLE hSnapShot, LPMODULEENTRY32W lpme, BOOL first )
if (lpme->dwSize < sizeof (MODULEENTRY32W))
{
SetLastError( ERROR_INSUFFICIENT_BUFFER );
WARN("Result buffer too small (req: %d, was: %ld)\n", sizeof(MODULEENTRY32W), lpme->dwSize);
WARN("Result buffer too small (was: %ld)\n", lpme->dwSize);
return FALSE;
}
if ((snap = MapViewOfFile( hSnapShot, FILE_MAP_ALL_ACCESS, 0, 0, 0 )))
......@@ -553,7 +553,7 @@ static BOOL module_nextA( HANDLE handle, LPMODULEENTRY32 lpme, BOOL first )
if (lpme->dwSize < sizeof(MODULEENTRY32))
{
SetLastError( ERROR_INSUFFICIENT_BUFFER );
WARN("Result buffer too small (req: %d, was: %ld)\n", sizeof(MODULEENTRY32), lpme->dwSize);
WARN("Result buffer too small (was: %ld)\n", lpme->dwSize);
return FALSE;
}
......
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