mirror of
https://github.com/moparisthebest/curl
synced 2024-12-25 01:28:51 -05:00
tool_doswin: Fix uninitialized field warning
The partial struct initialization in 397664a065
caused
a warning on uninitialized MODULEENTRY32 struct members:
/src/tool_doswin.c:681:3: warning: missing initializer for field
'th32ModuleID' of 'MODULEENTRY32 {aka struct tagMODULEENTRY32}'
[-Wmissing-field-initializers]
This is sort of a bogus warning as the remaining members will be set
to zero by the compiler, as all omitted members are. Nevertheless,
remove the warning by omitting all members and setting the dwSize
members explicitly.
Closes #3254
Reviewed-by: Marcel Raad <Marcel.Raad@teamviewer.com>
Reviewed-by: Jay Satiro <raysatiro@yahoo.com>
This commit is contained in:
parent
1cccf2f945
commit
b88bf6e650
@ -678,9 +678,11 @@ CURLcode FindWin32CACert(struct OperationConfig *config,
|
|||||||
struct curl_slist *GetLoadedModulePaths(void)
|
struct curl_slist *GetLoadedModulePaths(void)
|
||||||
{
|
{
|
||||||
HANDLE hnd = INVALID_HANDLE_VALUE;
|
HANDLE hnd = INVALID_HANDLE_VALUE;
|
||||||
MODULEENTRY32 mod = { sizeof(mod), };
|
MODULEENTRY32 mod = {0};
|
||||||
struct curl_slist *slist = NULL;
|
struct curl_slist *slist = NULL;
|
||||||
|
|
||||||
|
mod.dwSize = sizeof(MODULEENTRY32);
|
||||||
|
|
||||||
do {
|
do {
|
||||||
hnd = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, 0);
|
hnd = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, 0);
|
||||||
} while(hnd == INVALID_HANDLE_VALUE && GetLastError() == ERROR_BAD_LENGTH);
|
} while(hnd == INVALID_HANDLE_VALUE && GetLastError() == ERROR_BAD_LENGTH);
|
||||||
|
Loading…
Reference in New Issue
Block a user