Skip to contentSkip to conversation

Fix non-portable format string in usb-ccid.c

PATCH Applied David Gibson 2 participants 2 messages Apr 4, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix non-portable format string in usb-ccid.c

At one point, usb-ccid.c attempts to use a %lX format specifier to print a uint64_t, which is only correct on some host platforms. This patch corrects the statement to use the stdint specified PRIX64 constant instead.

---
 hw/usb-ccid.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
hw/usb-ccid.c +1 -1
index 723b2e3..44156cc 100644
@@ -1199,7 +1199,7 @@ void ccid_card_card_error(CCIDCardState *card, uint64_t error)
 
     s->bmCommandStatus = COMMAND_STATUS_FAILED;
     s->last_answer_error = error;
-    DPRINTF(s, 1, "VSC_Error: %lX\n", s->last_answer_error);
+    DPRINTF(s, 1, "VSC_Error: %" PRIX64 "\n", s->last_answer_error);
     /* TODO: these error's should be more verbose and propogated to the guest.*/
     /*
      * We flush all pending answers on CardRemove message in ccid-card-passthru,
Signature · 1 line
1.7.1
#1 lore raw
Quoted 8 lines · David Gibson

At one point, usb-ccid.c attempts to use a %lX format specifier to print a uint64_t, which is only correct on some host platforms. This patch corrects the statement to use the stdint specified PRIX64 constant instead.

---
 hw/usb-ccid.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Thanks, applied.

Quoted 18 lines
hw/usb-ccid.c +1 -1
index 723b2e3..44156cc 100644
@@ -1199,7 +1199,7 @@ void ccid_card_card_error(CCIDCardState *card, uint64_t error)
 
     s->bmCommandStatus = COMMAND_STATUS_FAILED;
     s->last_answer_error = error;
-    DPRINTF(s, 1, "VSC_Error: %lX\n", s->last_answer_error);
+    DPRINTF(s, 1, "VSC_Error: %" PRIX64 "\n", s->last_answer_error);
     /* TODO: these error's should be more verbose and propogated to the guest.*/
     /*
      * We flush all pending answers on CardRemove message in ccid-card-passthru,
Signature · 1 line
1.7.1
Signature · 2 lines
Aurelien Jarno                          GPG: 1024D/F1BCDB73
[email protected]                 http://www.aurel32.net