From: grauerfuchs <42082416+grauerfuchs@users.noreply.github.com> Date: Fri, 6 Dec 2019 15:06:24 +0000 (-0500) Subject: Bugfix: Output typing on print of HID card formats (#895) X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/commitdiff_plain/763d1befc1b9251c49cc88a50c73a3096323736a?ds=inline;hp=-c Bugfix: Output typing on print of HID card formats (#895) * Bugfix: Output typing on print of HID card formats The 'PrintAndLog' calls were using signed types and sometimes too few bits in width for formatting/outputting the data as was revealed in the forums. This commit will correct the printf-formatted output typing on display of the fields. * Update hidcardformats.c Updated to use macros as requested by @pwpiwi --- 763d1befc1b9251c49cc88a50c73a3096323736a diff --git a/client/hidcardformats.c b/client/hidcardformats.c index 11d0558e..b38ebc54 100644 --- a/client/hidcardformats.c +++ b/client/hidcardformats.c @@ -574,13 +574,13 @@ bool HIDPack(/* in */int FormatIndex, /* in */hidproxcard_t* card, /* out */hidp void HIDDisplayUnpackedCard(hidproxcard_t* card, const hidcardformat_t format){ PrintAndLog(" Format: %s (%s)", format.Name, format.Descrp); if (format.Fields.hasFacilityCode) - PrintAndLog("Facility Code: %d",card->FacilityCode); + PrintAndLog("Facility Code: %" PRIu32,card->FacilityCode); if (format.Fields.hasCardNumber) - PrintAndLog(" Card Number: %d",card->CardNumber); + PrintAndLog(" Card Number: %" PRIu64,card->CardNumber); if (format.Fields.hasIssueLevel) - PrintAndLog(" Issue Level: %d",card->IssueLevel); + PrintAndLog(" Issue Level: %" PRIu32,card->IssueLevel); if (format.Fields.hasOEMCode) - PrintAndLog(" OEM Code: %d",card->OEM); + PrintAndLog(" OEM Code: %" PRIu32,card->OEM); if (format.Fields.hasParity) PrintAndLog(" Parity: %s",card->ParityValid ? "Valid" : "Invalid"); }