Skip to content

Commit

Permalink
qga: Fix two format strings for MinGW
Browse files Browse the repository at this point in the history
Both code locations cause a compiler warning. Using "%s" instead of "%lu"
would result in a program crash if the wrong code were executed.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Message-id: 1385409257-2522-1-git-send-email-sw@weilnetz.de
Signed-off-by: Anthony Liguori <aliguori@amazon.com>
  • Loading branch information
stweil authored and Anthony Liguori committed Nov 26, 2013
1 parent 84dc96e commit 16f4e8f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions qga/commands-win32.c
Expand Up @@ -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);
}
}
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 16f4e8f

Please sign in to comment.