Skip to contentSkip to conversation

qga: Fix two format strings for MinGW

PATCH New Stefan Weil 1 participant 1 message Nov 25, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qga: Fix two format strings for MinGW

Both code locations cause a compiler warning. Using "%s" instead of "%lu" would result in a program crash if the wrong code were executed.

---
 qga/commands-win32.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
qga/commands-win32.c +2 -2
index 7a37f5c..a6a0af2 100644
@@ -110,7 +110,7 @@ void qmp_guest_shutdown(bool has_mode, const char *mode, Error **err)
     }
 
     if (!ExitWindowsEx(shutdown_flag, SHTDN_REASON_FLAG_PLANNED)) {
-        slog("guest-shutdown failed: %d", GetLastError());
+        slog("guest-shutdown failed: %lu", GetLastError());
         error_set(err, QERR_UNDEFINED_ERROR);
     }
 }
@@ -301,7 +301,7 @@ static DWORD WINAPI do_suspend(LPVOID opaque)
     DWORD ret = 0;
 
     if (!SetSuspendState(*mode == GUEST_SUSPEND_MODE_DISK, TRUE, TRUE)) {
-        slog("failed to suspend guest, %s", GetLastError());
+        slog("failed to suspend guest, %lu", GetLastError());
         ret = -1;
     }
     g_free(mode);
Signature · 1 line
1.7.10.4