clang fix

This commit is contained in:
iceman1001 2021-04-17 15:17:39 +02:00
commit be6a9273ec
4 changed files with 6 additions and 7 deletions

View file

@ -56,10 +56,10 @@ json_t *AIDSearchInit(bool verbose) {
return root; 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); json_t *data = json_array_get(root, elmindx);
if (!json_is_object(data)) { 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 NULL;
} }
return data; return data;
@ -121,7 +121,7 @@ int PrintAIDDescription(json_t *xroot, char *aid, bool verbose) {
json_t *elm = NULL; json_t *elm = NULL;
uint32_t maxaidlen = 0; 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); json_t *data = AIDSearchGetElm(root, elmindx);
if (data == NULL) if (data == NULL)
continue; continue;

View file

@ -20,7 +20,7 @@
int PrintAIDDescription(json_t *xroot, char *aid, bool verbose); int PrintAIDDescription(json_t *xroot, char *aid, bool verbose);
int PrintAIDDescriptionBuf(json_t *root, uint8_t *aid, size_t aidlen, bool verbose); int PrintAIDDescriptionBuf(json_t *root, uint8_t *aid, size_t aidlen, bool verbose);
json_t *AIDSearchInit(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); bool AIDGetFromElm(json_t *data, uint8_t *aid, size_t aidmaxlen, int *aidlen);
int AIDSearchFree(json_t *root); int AIDSearchFree(json_t *root);

View file

@ -1989,7 +1989,7 @@ int infoHF14A(bool verbose, bool do_nack_test, bool do_aid_search) {
PrintAndLogEx(INFO, "-------------------- " _CYAN_("AID Search") " --------------------"); PrintAndLogEx(INFO, "-------------------- " _CYAN_("AID Search") " --------------------");
bool found = false; bool found = false;
int elmindx = 0; size_t elmindx = 0;
json_t *root = AIDSearchInit(verbose); json_t *root = AIDSearchInit(verbose);
if (root != NULL) { if (root != NULL) {
bool ActivateField = true; bool ActivateField = true;

View file

@ -53,7 +53,6 @@ static uint16_t get_sw(uint8_t *d, uint8_t n) {
static void hf14b_aid_search(bool verbose) { static void hf14b_aid_search(bool verbose) {
int elmindx = 0;
json_t *root = AIDSearchInit(verbose); json_t *root = AIDSearchInit(verbose);
if (root == NULL) { if (root == NULL) {
switch_off_field_14b(); switch_off_field_14b();
@ -65,7 +64,7 @@ static void hf14b_aid_search(bool verbose) {
bool found = false; bool found = false;
bool leave_signal_on = true; bool leave_signal_on = true;
bool activate_field = 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()) { if (kbd_enter_pressed()) {
break; break;