From d2dcce30d37cc81a52d6d38658a46325f111e05c Mon Sep 17 00:00:00 2001 From: Yang Kun <91833768+ikspress@users.noreply.github.com> Date: Wed, 10 Jul 2024 21:57:23 +0800 Subject: [PATCH] Fix incorrect condition check warning: result of comparison of constant 0 with expression of type 'bool' is always false [-Wtautological-constant-compare] --- src/mfcuk.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mfcuk.c b/src/mfcuk.c index ec4cf0e..641250a 100644 --- a/src/mfcuk.c +++ b/src/mfcuk.c @@ -1570,14 +1570,14 @@ int main(int argc, char *argv[]) ERR("tag was removed or cannot be selected"); } - if (0 > nfc_initiator_mifare_cmd(pnd, k, block, &mp)) { - ERR("AUTH sector %d, block %d, key %012"PRIx64", key-type 0x%02x, error code 0x%02x", i, block, crntVerifKey, k, uiErrCode); - } else { + if (nfc_initiator_mifare_cmd(pnd, k, block, &mp)) { // Mark current key-type as verified ptr_trailer->abtAccessBits[result_byte] |= ACTIONS_VERIFY; // Copy default key on top of dump only in case default keys option was specified in command line and the default key matched memcpy((k == keyA) ? (ptr_trailer->abtKeyA) : (ptr_trailer->abtKeyB), current_default_keys[j], MIFARE_CLASSIC_KEY_BYTELENGTH); + } else { + ERR("AUTH sector %d, block %d, key %012"PRIx64", key-type 0x%02x, error code 0x%02x", i, block, crntVerifKey, k, uiErrCode); } } // for (j = 0; (j < crntNumVerifKeys); j++) } // for (i=0; i