Fix some PRI* macro usage.

This commit is contained in:
Jean-Michel Picod 2024-11-04 11:31:30 +01:00
commit 68734f4191

View file

@ -392,7 +392,7 @@ static void piv_tag_dump_int_array(const struct tlv *tlv, const struct piv_tag *
for (int i = 0; i < sub_tlv.len; i++) { for (int i = 0; i < sub_tlv.len; i++) {
v = (v << 8) + sub_tlv.value[i]; v = (v << 8) + sub_tlv.value[i];
} }
PrintAndLogEx(NORMAL, _YELLOW_("%" PRIu32) " bytes (" _YELLOW_("%" PRIx32) ")", v, v); PrintAndLogEx(NORMAL, _YELLOW_("%" PRIu64) " bytes (" _YELLOW_("%" PRIx64) ")", v, v);
} else { } else {
// Number is to big. Just print hex value // Number is to big. Just print hex value
PrintAndLogEx(NORMAL, _YELLOW_("0x%s"), sprint_hex_inrow(sub_tlv.value, sub_tlv.len)); PrintAndLogEx(NORMAL, _YELLOW_("0x%s"), sprint_hex_inrow(sub_tlv.value, sub_tlv.len));
@ -491,7 +491,7 @@ static bool piv_tag_dump(const struct tlv *tlv, int level) {
PrintAndLogEx(NORMAL, " '" _YELLOW_("%s")"'", sprint_hex_inrow(tlv->value, tlv->len)); PrintAndLogEx(NORMAL, " '" _YELLOW_("%s")"'", sprint_hex_inrow(tlv->value, tlv->len));
break; break;
case PIV_TAG_NUMERIC: case PIV_TAG_NUMERIC:
PrintAndLogEx(NORMAL, " " _YELLOW_("%" PRIu32), piv_value_numeric(tlv, 0, tlv->len * 2)); PrintAndLogEx(NORMAL, " " _YELLOW_("%" PRIu64), piv_value_numeric(tlv, 0, tlv->len * 2));
break; break;
case PIV_TAG_YYYYMMDD: case PIV_TAG_YYYYMMDD:
piv_tag_dump_yyyymmdd(tlv, tag, level); piv_tag_dump_yyyymmdd(tlv, tag, level);
@ -709,7 +709,7 @@ static int PivAuthenticateSign(Iso7816CommandChannel channel, uint8_t alg_id, ui
const size_t MAX_NONCE_LEN = 0x7a; const size_t MAX_NONCE_LEN = 0x7a;
if (nonce_len > MAX_NONCE_LEN) { if (nonce_len > MAX_NONCE_LEN) {
if (verbose == true) { if (verbose == true) {
PrintAndLogEx(WARNING, "Nonce cannot exceed %" PRIi32 " bytes. Got %" PRIi32 " bytes.", MAX_NONCE_LEN, nonce_len); PrintAndLogEx(WARNING, "Nonce cannot exceed %" PRIu64 " bytes. Got %" PRIu64 " bytes.", MAX_NONCE_LEN, nonce_len);
} }
return PM3_EINVARG; return PM3_EINVARG;
} }