diff --git a/client/src/cmdhficlass.c b/client/src/cmdhficlass.c index 6ee9d9ff8..ce21819f9 100644 --- a/client/src/cmdhficlass.c +++ b/client/src/cmdhficlass.c @@ -7960,7 +7960,7 @@ static int CmdHFiClassConfigCard(const char *Cmd) { if (ccidx > -1 && ccidx < ARRAYLEN(iclass_config_options)) { const iclass_config_card_item_t *item = get_config_card_item(ccidx); if (strlen(item->desc) == 0) { - PrintAndLogEx(ERR, "out of range, %u (got %u)", ARRAYLEN(iclass_config_options), ccidx); + PrintAndLogEx(ERR, "out of range, %zu (got %u)", ARRAYLEN(iclass_config_options), ccidx); return PM3_EINVARG; } if (strstr(item->desc, "ELITE") != NULL && got_kr == false) { diff --git a/client/src/cmdhfmf.c b/client/src/cmdhfmf.c index 2a9cf55cd..f6ab13d85 100644 --- a/client/src/cmdhfmf.c +++ b/client/src/cmdhfmf.c @@ -11288,7 +11288,7 @@ static int CmdHF14AMfValue(const char *Cmd) { optionsprovided++; action = 0; if ((incval <= 0) || (incval > 2147483647)) { - PrintAndLogEx(WARNING, "increment value must be between 1 and 2147483647. Got %lli", incval); + PrintAndLogEx(WARNING, "increment value must be between 1 and 2147483647. Got %" PRId64, incval); return PM3_EINVARG; } else value = (uint32_t)incval; @@ -11298,7 +11298,7 @@ static int CmdHF14AMfValue(const char *Cmd) { optionsprovided++; action = 1; if ((decval <= 0) || (decval > 2147483647)) { - PrintAndLogEx(WARNING, "decrement value must be between 1 and 2147483647. Got %lli", decval); + PrintAndLogEx(WARNING, "decrement value must be between 1 and 2147483647. Got %" PRId64, decval); return PM3_EINVARG; } else value = (uint32_t)decval; @@ -11308,7 +11308,7 @@ static int CmdHF14AMfValue(const char *Cmd) { optionsprovided++; action = 3; if ((setval < -2147483647) || (setval > 2147483647)) { - PrintAndLogEx(WARNING, "set value must be between -2147483647 and 2147483647. Got %lli", setval); + PrintAndLogEx(WARNING, "set value must be between -2147483647 and 2147483647. Got %" PRId64, setval); return PM3_EINVARG; } else value = (uint32_t)setval; diff --git a/client/src/cmdhfmfdes.c b/client/src/cmdhfmfdes.c index bd392a023..c7a6d8a5c 100644 --- a/client/src/cmdhfmfdes.c +++ b/client/src/cmdhfmfdes.c @@ -314,7 +314,7 @@ static int CLIGetUint32Hex(CLIParserContext *ctx, uint8_t paramnum, uint32_t def *valuePresent = (res == 1); if (res == 2) { - PrintAndLogEx(ERR, lengthErrorStr); + PrintAndLogEx(ERR, "%s", lengthErrorStr); return PM3_EINVARG; } if (res == 0) { diff --git a/client/src/cmdhfmfp.c b/client/src/cmdhfmfp.c index 9887f28c6..1e8ff394f 100644 --- a/client/src/cmdhfmfp.c +++ b/client/src/cmdhfmfp.c @@ -1344,7 +1344,7 @@ static int CmdHFMFPChKey(const char *Cmd) { } if (verbose) { - PrintAndLogEx(INFO, "--key index:", sprint_hex(keyn, 2)); + PrintAndLogEx(INFO, "--key index: %s", sprint_hex(keyn, 2)); } int res = MifareAuth4(&mf4session, keyn, key, false, true, true, true, verbose, false); @@ -1462,7 +1462,7 @@ static int CmdHFMFPChConf(const char *Cmd) { keyn[1] = usecck ? 0x01 : 0x00; if (verbose) { - PrintAndLogEx(INFO, "--key index:", sprint_hex(keyn, 2)); + PrintAndLogEx(INFO, "--key index: %s", sprint_hex(keyn, 2)); } int res = MifareAuth4(&mf4session, keyn, key, false, true, true, true, verbose, false); diff --git a/client/src/cmdhfmfsen.c b/client/src/cmdhfmfsen.c index 0ab3a22bd..5682b5cba 100644 --- a/client/src/cmdhfmfsen.c +++ b/client/src/cmdhfmfsen.c @@ -2175,7 +2175,7 @@ static void fm11_print_key_hit_row(uint32_t nonce_count, uint8_t sec, uint8_t kt " Key sec " _YELLOW_("%03u") " key " _YELLOW_("%c") " = " _GREEN_("%012" PRIX64) " |" " " _YELLOW_("%25s") " | %13s ", (float)elapsed_key / 1000.0, nonce_count, - fm11_real_sector(sec), kt ? 'B' : 'A', key & 0xFFFFFFFFFFFFULL, + fm11_real_sector(sec), kt ? 'B' : 'A', (uint64_t)(key & 0xFFFFFFFFFFFFULL), kcount, ""); } diff --git a/client/src/cmdhfsaflok.c b/client/src/cmdhfsaflok.c index 69d9e5462..016f9fa53 100644 --- a/client/src/cmdhfsaflok.c +++ b/client/src/cmdhfsaflok.c @@ -1603,12 +1603,12 @@ static int CmdHFSaflokSelfTest(const char *Cmd) { uint32_t value_set = (uint32_t)iter; bool success = set_bitfield(&testdata, start_bit, num_bits, value_set); if (!success) { - PrintAndLogEx(FAILED, "set_bitfield failed for start_bit %zu, num_bits %zu, test_value " PRIx32, start_bit, num_bits, value_set); + PrintAndLogEx(FAILED, "set_bitfield failed for start_bit %zu, num_bits %zu, test_value %" PRIx32, start_bit, num_bits, value_set); result_bitfield = PM3_EFAILED; } uint32_t x = get_bitfield(&testdata, start_bit, num_bits); if (x != value_set) { - PrintAndLogEx(FAILED, "get/set_bitfield failed for start_bit %zu, num_bits %zu, test_value " PRIx32 ": got " PRIx32", expected " PRIx32, start_bit, num_bits, value_set, x, value_set); + PrintAndLogEx(FAILED, "get/set_bitfield failed for start_bit %zu, num_bits %zu, test_value %" PRIx32 ": got %" PRIx32", expected %" PRIx32, start_bit, num_bits, value_set, x, value_set); result_bitfield = PM3_EFAILED; } // Clear the field for the next test diff --git a/client/src/cmdhfwaveshare.c b/client/src/cmdhfwaveshare.c index 6f1d7efe9..7dd216e43 100644 --- a/client/src/cmdhfwaveshare.c +++ b/client/src/cmdhfwaveshare.c @@ -665,7 +665,7 @@ static int CmdHF14AWSLoad(const char *Cmd) { gdImageDestroy(pal_img); return PM3_SUCCESS; } else { - PrintAndLogEx(WARNING, "Could not save converted image", outfile); + PrintAndLogEx(WARNING, "Could not save converted image %s", outfile); gdImageDestroy(pal_img); return PM3_EFILE; } diff --git a/client/src/cmdhw.c b/client/src/cmdhw.c index 386f3f556..5dd774bde 100644 --- a/client/src/cmdhw.c +++ b/client/src/cmdhw.c @@ -2365,8 +2365,8 @@ void pm3_version(bool verbose, bool oneliner) { PrintAndLogEx(NORMAL, " Device.................... " _GREEN_("RDV4")); PrintAndLogEx(NORMAL, " Firmware.................. " _GREEN_("RDV4")); } else if (type == SIGN_GENERIC) { - PrintAndLogEx(NORMAL, " Device.................... ", _GREEN_("GENERIC")); - PrintAndLogEx(NORMAL, " Firmware.................. ", _GREEN_("GENERIC")); + PrintAndLogEx(NORMAL, " Device.................... " _GREEN_("GENERIC")); + PrintAndLogEx(NORMAL, " Firmware.................. " _GREEN_("GENERIC")); } else { PrintAndLogEx(NORMAL, " Device.................... " _RED_("Bad signature detected!")); PrintAndLogEx(NORMAL, " Firmware.................. " _YELLOW_("N/A")); @@ -2413,7 +2413,7 @@ void pm3_version(bool verbose, bool oneliner) { } } } - PrintAndLogEx(NORMAL, payload->versionstr); + PrintAndLogEx(NORMAL, "%s", payload->versionstr); // PM5 doesn't report a built-in FPGA version (Gowin bitstream is loaded // externally), so skip the Xilinx FPGA_TYPE match check for it. if (!IfPm5() && strstr(payload->versionstr, FPGA_TYPE) == NULL) { diff --git a/client/src/cmdlfhitaghts.c b/client/src/cmdlfhitaghts.c index 64a7b3fdd..4c83133b2 100644 --- a/client/src/cmdlfhitaghts.c +++ b/client/src/cmdlfhitaghts.c @@ -477,7 +477,7 @@ static int CmdLFHitagSRead(const char *Cmd) { break; } if (card->pages_reason[i] >= 0) { - PrintAndLogEx(SUCCESS, "% 3u | %s | " NOLF, page_addr, sprint_hex_ascii(card->pages[i], HITAGS_PAGE_SIZE)); + PrintAndLogEx(SUCCESS, "%3u | %s | " NOLF, page_addr, sprint_hex_ascii(card->pages[i], HITAGS_PAGE_SIZE)); // access right if (page_addr == HITAGS_UID_PADR) { @@ -557,7 +557,7 @@ static int CmdLFHitagSRead(const char *Cmd) { } else PrintAndLogEx(NORMAL, "Data"); } else { - PrintAndLogEx(INFO, "% 3u | -- -- -- -- | .... | N/A | " NOLF, page_addr); + PrintAndLogEx(INFO, "%3u | -- -- -- -- | .... | N/A | " NOLF, page_addr); print_error(card->pages_reason[i]); } } diff --git a/client/src/cmdlfhitagu.c b/client/src/cmdlfhitagu.c index 573539a6b..1f2298f43 100644 --- a/client/src/cmdlfhitagu.c +++ b/client/src/cmdlfhitagu.c @@ -221,7 +221,7 @@ int read_htu_uid(void) { return PM3_ESOFT; } - PrintAndLogEx(SUCCESS, "UID....... " _GREEN_("%012llX"), uid); + PrintAndLogEx(SUCCESS, "UID....... " _GREEN_("%012" PRIX64), uid); // PrintAndLogEx(SUCCESS, "TYPE...... " _GREEN_("%s"), htu_get_type_str(uid)); return PM3_SUCCESS; } @@ -456,7 +456,7 @@ static int CmdLFHitagURead(const char *Cmd) { } if (card->pages_reason[i] > 0) { - PrintAndLogEx(SUCCESS, "% 3u | %s | " NOLF, page_addr, sprint_hex_ascii(card->pages[i], HITAGU_BLOCK_SIZE)); + PrintAndLogEx(SUCCESS, "%3u | %s | " NOLF, page_addr, sprint_hex_ascii(card->pages[i], HITAGU_BLOCK_SIZE)); // access right // 82xx @@ -508,7 +508,7 @@ static int CmdLFHitagURead(const char *Cmd) { PrintAndLogEx(NORMAL, "Data"); } } else { - PrintAndLogEx(INFO, "% 3u | -- -- -- -- | .... | N/A | " NOLF, page_addr); + PrintAndLogEx(INFO, "%3u | -- -- -- -- | .... | N/A | " NOLF, page_addr); print_error(card->pages_reason[i]); } } diff --git a/client/src/cmdlft55xx.c b/client/src/cmdlft55xx.c index 9c1dd99dc..a5608f7a3 100644 --- a/client/src/cmdlft55xx.c +++ b/client/src/cmdlft55xx.c @@ -1017,7 +1017,7 @@ static void T55xx_Print_DownlinkMode(uint8_t downlink_mode) { break; } - PrintAndLogEx(SUCCESS, msg); + PrintAndLogEx(SUCCESS, "%s", msg); } static int CmdT55xxWakeUp(const char *Cmd) { diff --git a/client/src/fileutils.c b/client/src/fileutils.c index 2a2e710d5..d68d839a1 100644 --- a/client/src/fileutils.c +++ b/client/src/fileutils.c @@ -2980,7 +2980,7 @@ int loadFileJSONex(const char *preferredName, void *data, size_t maxdatalen, siz ); if (*datalen > ISO15693_TAG_MAX_SIZE) { - PrintAndLogEx(ERR, "loadFileJSONex: maxdatalen=%zu (%04zx) sptr=%zu (%04zx) -- exceeded maxdatalen" + PrintAndLogEx(ERR, "loadFileJSONex: maxdatalen=%d (%04x) sptr=%zu (%04zx) -- exceeded maxdatalen" , ISO15693_TAG_MAX_SIZE , ISO15693_TAG_MAX_SIZE , *datalen @@ -2991,7 +2991,7 @@ int loadFileJSONex(const char *preferredName, void *data, size_t maxdatalen, siz } tag->pagesCount = *datalen / 4; if (tag->pagesCount > ISO15693_TAG_MAX_PAGES) { - PrintAndLogEx(ERR, "loadFileJSONex: maxpagecount=%zu (%04zx) pagecount=%u (%04x) -- exceeded maxpagecount" + PrintAndLogEx(ERR, "loadFileJSONex: maxpagecount=%d (%04x) pagecount=%u (%04x) -- exceeded maxpagecount" , ISO15693_TAG_MAX_PAGES , ISO15693_TAG_MAX_PAGES , tag->pagesCount @@ -3038,7 +3038,7 @@ int loadFileJSONex(const char *preferredName, void *data, size_t maxdatalen, siz tag->pagesCount = sptr / 4; if (tag->pagesCount > ISO15693_TAG_MAX_PAGES) { - PrintAndLogEx(ERR, "loadFileJSONex: maxpagecount=%zu (%04zx) pagecount=%u (%04x) -- exceeded maxpagecount" + PrintAndLogEx(ERR, "loadFileJSONex: maxpagecount=%d (%04x) pagecount=%u (%04x) -- exceeded maxpagecount" , ISO15693_TAG_MAX_PAGES , ISO15693_TAG_MAX_PAGES , tag->pagesCount @@ -3085,7 +3085,7 @@ int loadFileJSONex(const char *preferredName, void *data, size_t maxdatalen, siz tag->pagesCount = sptr / 8; if (tag->pagesCount > ISO15693_TAG_MAX_PAGES) { - PrintAndLogEx(ERR, "loadFileJSONex: maxpagecount=%zu (%04zx) pagecount=%u (%04x) -- exceeded maxpagecount" + PrintAndLogEx(ERR, "loadFileJSONex: maxpagecount=%d (%04x) pagecount=%u (%04x) -- exceeded maxpagecount" , ISO15693_TAG_MAX_PAGES , ISO15693_TAG_MAX_PAGES , tag->pagesCount diff --git a/client/src/flash.c b/client/src/flash.c index 931d055de..930b9a789 100644 --- a/client/src/flash.c +++ b/client/src/flash.c @@ -440,7 +440,7 @@ int flash_prepare(flash_file_t *ctx, int can_write_bl, flash_dev_t *flash_dev) { // Check elf file is build for currently connected device? if (!CheckInformationMagicAndChipType(ctx->ver_info, flash_dev->chiptype)) { - PrintAndLogEx(ERR, "The elf file is not applicable to the currently connected device.", flash_dev->chiptype); + PrintAndLogEx(ERR, "The elf file is not applicable to the currently connected device."); res = PM3_EFILE; goto fail; } diff --git a/client/src/graph.c b/client/src/graph.c index 46c6a3309..0bb403942 100644 --- a/client/src/graph.c +++ b/client/src/graph.c @@ -568,11 +568,11 @@ buffer_savestate_t save_buffer8(uint8_t *src, size_t length) { // 1/4 of the size needed size_t buffSize = (length / 4); - PrintAndLogEx(DEBUG, "(save_buffer8) buffSize = %llu, length = %llu", buffSize, length); + PrintAndLogEx(DEBUG, "(save_buffer8) buffSize = %zu, length = %zu", buffSize, length); if (length % 4) { buffSize++; - PrintAndLogEx(DEBUG, "(save_buffer8) new buffSize = %llu", buffSize); + PrintAndLogEx(DEBUG, "(save_buffer8) new buffSize = %zu", buffSize); } // calloc the memory needed diff --git a/client/src/loclass/cipherutils.c b/client/src/loclass/cipherutils.c index fea18e86b..4d29fd7e4 100644 --- a/client/src/loclass/cipherutils.c +++ b/client/src/loclass/cipherutils.c @@ -151,7 +151,7 @@ void printarr(const char *name, uint8_t *arr, int len) { snprintf(output + cx, outsize - cx, "};"); } - PrintAndLogEx(INFO, output); + PrintAndLogEx(INFO, "%s", output); free(output); } @@ -195,7 +195,7 @@ void printarr_human_readable(const char *title, uint8_t *arr, int len) { cx += snprintf(output + cx, outsize - cx, "%02x ", *(arr + i)); } } - PrintAndLogEx(INFO, output); + PrintAndLogEx(INFO, "%s", output); free(output); }