diff options
author | João Valverde <j@v6e.pt> | 2023-01-12 03:43:59 +0000 |
---|---|---|
committer | João Valverde <j@v6e.pt> | 2023-01-13 15:48:03 +0000 |
commit | d902cabd3fb880a2d2ff348cde4a4df6246d1d32 (patch) | |
tree | f5591f735e89a498a0c48833eb97297e29d5b1a9 /wsutil | |
parent | 8cd74b7cd475cf7e2321c34ed2dcc29c09a961a6 (diff) |
MinGW: Fix -Wformat
Diffstat (limited to 'wsutil')
-rw-r--r-- | wsutil/filesystem.c | 4 | ||||
-rw-r--r-- | wsutil/win32-utils.c | 2 | ||||
-rw-r--r-- | wsutil/ws_pipe.c | 22 |
3 files changed, 14 insertions, 14 deletions
diff --git a/wsutil/filesystem.c b/wsutil/filesystem.c index c80f92070b..6e5ba34889 100644 --- a/wsutil/filesystem.c +++ b/wsutil/filesystem.c @@ -624,7 +624,7 @@ configuration_init_w32(const char* arg0 _U_) /* * Gak. We can't format the message. */ - return ws_strdup_printf("GetModuleFileName failed: %u (FormatMessage failed: %u)", + return ws_strdup_printf("GetModuleFileName failed: %lu (FormatMessage failed: %lu)", error, GetLastError()); } msg = utf_16to8(msg_w); @@ -638,7 +638,7 @@ configuration_init_w32(const char* arg0 _U_) msg[msglen - 1] = '\0'; msg[msglen - 2] = '\0'; } - return ws_strdup_printf("GetModuleFileName failed: %s (%u)", + return ws_strdup_printf("GetModuleFileName failed: %s (%lu)", msg, error); } diff --git a/wsutil/win32-utils.c b/wsutil/win32-utils.c index fe49001c4f..97f586768c 100644 --- a/wsutil/win32-utils.c +++ b/wsutil/win32-utils.c @@ -183,7 +183,7 @@ win32strexception(DWORD exception) if (exceptions[i].code == exception) return exceptions[i].msg; } - snprintf(errbuf, (gulong)sizeof errbuf, "Exception 0x%08x", exception); + snprintf(errbuf, (gulong)sizeof errbuf, "Exception 0x%08lx", exception); return errbuf; } diff --git a/wsutil/ws_pipe.c b/wsutil/ws_pipe.c index da3b3a274b..af81f9de80 100644 --- a/wsutil/ws_pipe.c +++ b/wsutil/ws_pipe.c @@ -125,7 +125,7 @@ ws_pipe_create_overlapped_read(HANDLE *read_pipe_handle, HANDLE *write_pipe_hand SECURITY_ATTRIBUTES *sa, DWORD suggested_buffer_size) { HANDLE read_pipe, write_pipe; - guchar *name = ws_strdup_printf("\\\\.\\Pipe\\WiresharkWsPipe.%08x.%08x", + guchar *name = ws_strdup_printf("\\\\.\\Pipe\\WiresharkWsPipe.%08lx.%08lx", GetCurrentProcessId(), InterlockedIncrement(&pipe_serial_number)); gunichar2 *wname = g_utf8_to_utf16(name, -1, NULL, NULL, NULL); @@ -336,7 +336,7 @@ gboolean ws_pipe_spawn_sync(const gchar *working_directory, const gchar *command { if (GetLastError() != ERROR_IO_PENDING) { - ws_debug("ReadFile on child stdout pipe failed. Error %d", GetLastError()); + ws_debug("ReadFile on child stdout pipe failed. Error %ld", GetLastError()); pending_stdout = FALSE; } } @@ -345,7 +345,7 @@ gboolean ws_pipe_spawn_sync(const gchar *working_directory, const gchar *command { if (GetLastError() != ERROR_IO_PENDING) { - ws_debug("ReadFile on child stderr pipe failed. Error %d", GetLastError()); + ws_debug("ReadFile on child stderr pipe failed. Error %ld", GetLastError()); pending_stderr = FALSE; } } @@ -396,7 +396,7 @@ gboolean ws_pipe_spawn_sync(const gchar *working_directory, const gchar *command pending_stdout = FALSE; continue; } - ws_debug("GetOverlappedResult on stdout failed. Error %d", GetLastError()); + ws_debug("GetOverlappedResult on stdout failed. Error %ld", GetLastError()); } if (process_finished && (bytes_read == 0)) { @@ -409,7 +409,7 @@ gboolean ws_pipe_spawn_sync(const gchar *working_directory, const gchar *command { if (GetLastError() != ERROR_IO_PENDING) { - ws_debug("ReadFile on child stdout pipe failed. Error %d", GetLastError()); + ws_debug("ReadFile on child stdout pipe failed. Error %ld", GetLastError()); pending_stdout = FALSE; } } @@ -425,7 +425,7 @@ gboolean ws_pipe_spawn_sync(const gchar *working_directory, const gchar *command pending_stderr = FALSE; continue; } - ws_debug("GetOverlappedResult on stderr failed. Error %d", GetLastError()); + ws_debug("GetOverlappedResult on stderr failed. Error %ld", GetLastError()); } if (process_finished && (bytes_read == 0)) { @@ -436,7 +436,7 @@ gboolean ws_pipe_spawn_sync(const gchar *working_directory, const gchar *command { if (GetLastError() != ERROR_IO_PENDING) { - ws_debug("ReadFile on child stderr pipe failed. Error %d", GetLastError()); + ws_debug("ReadFile on child stderr pipe failed. Error %ld", GetLastError()); pending_stderr = FALSE; } } @@ -444,7 +444,7 @@ gboolean ws_pipe_spawn_sync(const gchar *working_directory, const gchar *command } else { - ws_debug("WaitForMultipleObjects returned 0x%08X. Error %d", dw, GetLastError()); + ws_debug("WaitForMultipleObjects returned 0x%08lX. Error %ld", dw, GetLastError()); } } @@ -721,7 +721,7 @@ ws_pipe_wait_for_pipe(HANDLE * pipe_handles, int num_pipe_handles, HANDLE pid) break; default: - ws_debug("ConnectNamedPipe failed with %d\n.", error); + ws_debug("ConnectNamedPipe failed with %ld\n.", error); result = FALSE; } } @@ -776,7 +776,7 @@ ws_pipe_wait_for_pipe(HANDLE * pipe_handles, int num_pipe_handles, HANDLE pid) TRUE); // wait if (!success) { - ws_debug("Error %d \n.", GetLastError()); + ws_debug("Error %ld \n.", GetLastError()); result = FALSE; } pipeinsts[i].pendingIO = FALSE; @@ -785,7 +785,7 @@ ws_pipe_wait_for_pipe(HANDLE * pipe_handles, int num_pipe_handles, HANDLE pid) } else { - ws_debug("WaitForMultipleObjects returned 0x%08X. Error %d", dw, GetLastError()); + ws_debug("WaitForMultipleObjects returned 0x%08lX. Error %ld", dw, GetLastError()); result = FALSE; } } |