diff --git a/client/src/cmddata.c b/client/src/cmddata.c index 4bbad5fd5..5a295db1c 100644 --- a/client/src/cmddata.c +++ b/client/src/cmddata.c @@ -4081,12 +4081,12 @@ static int CmdTestSaveState8(const char *Cmd) { for (size_t i = 0; i < returnedLength; i++) { if (srcBuffer[i] != destBuffer[i]) { - PrintAndLogEx(FAILED, "Buffers don't match at index %lu!, Expected %i, got %i", i, srcBuffer[i], destBuffer[i]); + PrintAndLogEx(FAILED, "Buffers don't match at index %zu!, Expected %i, got %i", i, srcBuffer[i], destBuffer[i]); free(srcBuffer); free(destBuffer); return PM3_EFAILED; } - PrintAndLogEx(DEBUG, "Index %lu matches: %u", i, destBuffer[i]); + PrintAndLogEx(DEBUG, "Index %zu matches: %u", i, destBuffer[i]); } PrintAndLogEx(SUCCESS, _GREEN_("Save State (8-bit) test success!") "\n"); @@ -4146,12 +4146,12 @@ static int CmdTestSaveState32(const char *Cmd) { for (size_t i = 0; i < length; i++) { if (srcBuffer[i] != destBuffer[i]) { - PrintAndLogEx(FAILED, "Buffers don't match at index %lu!, Expected %i, got %i", i, srcBuffer[i], destBuffer[i]); + PrintAndLogEx(FAILED, "Buffers don't match at index %zu!, Expected %i, got %i", i, srcBuffer[i], destBuffer[i]); free(srcBuffer); free(destBuffer); return PM3_EFAILED; } - PrintAndLogEx(DEBUG, "Index %lu matches: %i", i, destBuffer[i]); + PrintAndLogEx(DEBUG, "Index %zu matches: %i", i, destBuffer[i]); } PrintAndLogEx(SUCCESS, _GREEN_("Save State (32-bit) test success!") "\n"); diff --git a/client/src/cmdflashmem.c b/client/src/cmdflashmem.c index 119314d46..4dab13f27 100644 --- a/client/src/cmdflashmem.c +++ b/client/src/cmdflashmem.c @@ -253,7 +253,7 @@ static void pm3_print_public_keys(void) { mbedtls_mpi_write_string(&rsa.E, 16, str_exp, sizeof(str_exp), &exlen); mbedtls_mpi_write_string(&rsa.N, 16, str_pk, sizeof(str_pk), &pklen); - PrintAndLogEx(INFO, "Len........ %"PRIu64, rsa.len); + PrintAndLogEx(INFO, "Len........ %zu", rsa.len); PrintAndLogEx(INFO, "Exponent... %s", str_exp); PrintAndLogEx(INFO, "Public key modulus N"); PrintAndLogEx(INFO, " %.64s", str_pk); diff --git a/client/src/cmdhfmf.c b/client/src/cmdhfmf.c index f6ab13d85..c3cb35f42 100644 --- a/client/src/cmdhfmf.c +++ b/client/src/cmdhfmf.c @@ -4425,7 +4425,7 @@ static int CmdHF14AMfSmartBrute(const char *Cmd) { if (keys_checked) { - PrintAndLogEx(INFO, "Current cracking speed (keys/s): %lu", + PrintAndLogEx(INFO, "Current cracking speed (keys/s): %" PRIu64, keys_checked / ((msclock() - t1) / 1000) ); @@ -4452,7 +4452,7 @@ static int CmdHF14AMfSmartBrute(const char *Cmd) { out: PrintAndLogEx(INFO, "Time in brute mode: " _YELLOW_("%.1fs") "\n", (float)((msclock() - t0) / 1000.0)); - PrintAndLogEx(INFO, "Total keys checked: " _YELLOW_("%lu") "\n", total_keys_checked); + PrintAndLogEx(INFO, "Total keys checked: " _YELLOW_("%" PRIu64) "\n", total_keys_checked); // check.. uint8_t found_keys = 0; for (i = 0; i < sectorsCnt; ++i) { diff --git a/client/src/cmdhfmfdes.c b/client/src/cmdhfmfdes.c index c7a6d8a5c..36e475360 100644 --- a/client/src/cmdhfmfdes.c +++ b/client/src/cmdhfmfdes.c @@ -7146,7 +7146,7 @@ static int CmdHF14ADesMakeMFCLicense(const char *Cmd) { license_len = 1 + 2 * num_blocks; } - PrintAndLogEx(loglevel, "Covering %lu sector%s in total", num_sectors, num_sectors != 1 ? "s" : ""); + PrintAndLogEx(loglevel, "Covering %zu sector%s in total", num_sectors, num_sectors != 1 ? "s" : ""); if (use_default_keys) { // by default: all key A FFFFFFFFFFFF, all key B readable diff --git a/client/src/cmdhfmfhard.c b/client/src/cmdhfmfhard.c index 2e4196813..041b8975e 100644 --- a/client/src/cmdhfmfhard.c +++ b/client/src/cmdhfmfhard.c @@ -453,7 +453,7 @@ static void init_bitflip_bitarrays(void) { exit(5); } if (generated_output_size != expected_output_size) { - PrintAndLogEx(ERR, "File read error with %s (3) got %lu instead of %lu bytes. Aborting...\n", state_file_name, generated_output_size, expected_output_size); + PrintAndLogEx(ERR, "File read error with %s (3) got %zu instead of %zu bytes. Aborting...\n", state_file_name, generated_output_size, expected_output_size); free(uncompressed_data); exit(5); } diff --git a/client/src/cmdpiv.c b/client/src/cmdpiv.c index dc4f0e87d..165f77c1f 100644 --- a/client/src/cmdpiv.c +++ b/client/src/cmdpiv.c @@ -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)); break; case PIV_TAG_NUMERIC: - PrintAndLogEx(NORMAL, " " _YELLOW_("%" PRIu64), piv_value_numeric(tlv, 0, tlv->len * 2)); + PrintAndLogEx(NORMAL, " " _YELLOW_("%lu"), piv_value_numeric(tlv, 0, tlv->len * 2)); break; case PIV_TAG_YYYYMMDD: piv_tag_dump_yyyymmdd(tlv, tag, level); @@ -710,7 +710,7 @@ static int PivAuthenticateSign(Iso7816CommandChannel channel, uint8_t alg_id, ui const size_t MAX_NONCE_LEN = 0x7a; if (nonce_len > MAX_NONCE_LEN) { if (verbose == true) { - PrintAndLogEx(WARNING, "Nonce cannot exceed %" PRIu64 " bytes. Got %" PRIu64 " bytes.", MAX_NONCE_LEN, nonce_len); + PrintAndLogEx(WARNING, "Nonce cannot exceed %zu bytes. Got %zu bytes.", MAX_NONCE_LEN, nonce_len); } return PM3_EINVARG; } diff --git a/client/src/cmdtrace.c b/client/src/cmdtrace.c index b1361b451..84b8a9f67 100644 --- a/client/src/cmdtrace.c +++ b/client/src/cmdtrace.c @@ -241,7 +241,7 @@ static uint32_t extractChallenges(uint32_t tracepos, uint32_t traceLen, uint8_t // sanity check tracking position is less than available trace size if (tracepos + TRACELOG_HDR_LEN + data_len + TRACELOG_PARITY_LEN(hdr) > traceLen) { - PrintAndLogEx(DEBUG, "trace pos offset %"PRIu64 " larger than reported tracelen %u", + PrintAndLogEx(DEBUG, "trace pos offset %zu larger than reported tracelen %u", tracepos + TRACELOG_HDR_LEN + data_len + TRACELOG_PARITY_LEN(hdr), traceLen ); @@ -665,7 +665,7 @@ static uint32_t printTraceLine(uint32_t tracepos, uint32_t traceLen, uint8_t *tr uint16_t data_len = hdr->data_len; if (tracepos + TRACELOG_HDR_LEN + data_len + TRACELOG_PARITY_LEN(hdr) > traceLen) { - PrintAndLogEx(DEBUG, "trace pos offset %"PRIu64 " larger than reported tracelen %u", + PrintAndLogEx(DEBUG, "trace pos offset %zu larger than reported tracelen %u", tracepos + TRACELOG_HDR_LEN + data_len + TRACELOG_PARITY_LEN(hdr), traceLen ); diff --git a/client/src/ksx6924/ksx6924core.c b/client/src/ksx6924/ksx6924core.c index 633310ae1..34838a19b 100644 --- a/client/src/ksx6924/ksx6924core.c +++ b/client/src/ksx6924/ksx6924core.c @@ -269,7 +269,7 @@ bool KSX6924ParsePurseInfo(const uint8_t *purseInfo, size_t purseLen, struct ksx if (purseLen != sizeof(_ksx6924_internal_purse_info_t)) { // Invalid size! - PrintAndLogEx(FAILED, "Expected %ld bytes, got %ld\n", sizeof(_ksx6924_internal_purse_info_t), purseLen); + PrintAndLogEx(FAILED, "Expected %zu bytes, got %zu\n", sizeof(_ksx6924_internal_purse_info_t), purseLen); return false; } @@ -493,7 +493,7 @@ bool KSX6924ParseInitializeCardResponse(const uint8_t *initCardResponse, size_t if (resp_len != sizeof(_ksx6924_initialize_card_response_t)) { // Invalid size! - PrintAndLogEx(FAILED, "Expected %ld bytes, got %ld\n", sizeof(_ksx6924_initialize_card_response_t), resp_len); + PrintAndLogEx(FAILED, "Expected %zu bytes, got %zu\n", sizeof(_ksx6924_initialize_card_response_t), resp_len); return false; } diff --git a/client/src/wiegand_formats.c b/client/src/wiegand_formats.c index 71658cb3e..b090e4087 100644 --- a/client/src/wiegand_formats.c +++ b/client/src/wiegand_formats.c @@ -1612,7 +1612,7 @@ void HIDListFormats(void) { ++i; } PrintAndLogEx(INFO, "------------------------------------------------------------"); - PrintAndLogEx(INFO, "Available card formats: " _YELLOW_("%" PRIu64), ARRAYLEN(FormatTable) - 1); + PrintAndLogEx(INFO, "Available card formats: " _YELLOW_("%zu"), ARRAYLEN(FormatTable) - 1); PrintAndLogEx(NORMAL, ""); return; }