diff --git a/client/src/aidsearch.c b/client/src/aidsearch.c index 3a9d55ace..795ebed15 100644 --- a/client/src/aidsearch.c +++ b/client/src/aidsearch.c @@ -56,10 +56,10 @@ json_t *AIDSearchInit(bool verbose) { return root; } -json_t *AIDSearchGetElm(json_t *root, int elmindx) { +json_t *AIDSearchGetElm(json_t *root, size_t elmindx) { json_t *data = json_array_get(root, elmindx); if (!json_is_object(data)) { - PrintAndLogEx(ERR, "data [%d] is not an object\n", elmindx); + PrintAndLogEx(ERR, "data [%zu] is not an object\n", elmindx); return NULL; } return data; @@ -121,7 +121,7 @@ int PrintAIDDescription(json_t *xroot, char *aid, bool verbose) { json_t *elm = NULL; uint32_t maxaidlen = 0; - for (uint32_t elmindx = 0; elmindx < json_array_size(root); elmindx++) { + for (size_t elmindx = 0; elmindx < json_array_size(root); elmindx++) { json_t *data = AIDSearchGetElm(root, elmindx); if (data == NULL) continue; diff --git a/client/src/aidsearch.h b/client/src/aidsearch.h index 585e173c6..e3783fd71 100644 --- a/client/src/aidsearch.h +++ b/client/src/aidsearch.h @@ -20,7 +20,7 @@ int PrintAIDDescription(json_t *xroot, char *aid, bool verbose); int PrintAIDDescriptionBuf(json_t *root, uint8_t *aid, size_t aidlen, bool verbose); json_t *AIDSearchInit(bool verbose); -json_t *AIDSearchGetElm(json_t *root, int elmindx); +json_t *AIDSearchGetElm(json_t *root, size_t elmindx); bool AIDGetFromElm(json_t *data, uint8_t *aid, size_t aidmaxlen, int *aidlen); int AIDSearchFree(json_t *root); diff --git a/client/src/cmdhf14a.c b/client/src/cmdhf14a.c index abac9e999..cc7266db4 100644 --- a/client/src/cmdhf14a.c +++ b/client/src/cmdhf14a.c @@ -1989,7 +1989,7 @@ int infoHF14A(bool verbose, bool do_nack_test, bool do_aid_search) { PrintAndLogEx(INFO, "-------------------- " _CYAN_("AID Search") " --------------------"); bool found = false; - int elmindx = 0; + size_t elmindx = 0; json_t *root = AIDSearchInit(verbose); if (root != NULL) { bool ActivateField = true; diff --git a/client/src/cmdhf14b.c b/client/src/cmdhf14b.c index 22cfaab4d..6ad2f90e3 100644 --- a/client/src/cmdhf14b.c +++ b/client/src/cmdhf14b.c @@ -53,7 +53,6 @@ static uint16_t get_sw(uint8_t *d, uint8_t n) { static void hf14b_aid_search(bool verbose) { - int elmindx = 0; json_t *root = AIDSearchInit(verbose); if (root == NULL) { switch_off_field_14b(); @@ -65,7 +64,7 @@ static void hf14b_aid_search(bool verbose) { bool found = false; bool leave_signal_on = true; bool activate_field = true; - for (elmindx = 0; elmindx < json_array_size(root); elmindx++) { + for (size_t elmindx = 0; elmindx < json_array_size(root); elmindx++) { if (kbd_enter_pressed()) { break;