diff --git a/libfreefare/freefare.c b/libfreefare/freefare.c index 1b3304a..9952bc7 100644 --- a/libfreefare/freefare.c +++ b/libfreefare/freefare.c @@ -53,8 +53,8 @@ freefare_tag_new (nfc_device_t *device, nfc_iso14443a_info_t nai) for (size_t i = 0; i < sizeof (supported_tags) / sizeof (struct supported_tag); i++) { if (((nai.szUidLen == 4) || (nai.abtUid[0] == NXP_MANUFACTURER_CODE)) && (nai.btSak == supported_tags[i].SAK) && - (!supported_tags[i].ATS_length || (nai.szAtsLen == supported_tags[i].ATS_length) && - (0 == memcmp (nai.abtAts, supported_tags[i].ATS, ATS_LENGTH)))) { + (!supported_tags[i].ATS_length || ((nai.szAtsLen == supported_tags[i].ATS_length) && + (0 == memcmp (nai.abtAts, supported_tags[i].ATS, ATS_LENGTH))))) { tag_info = &(supported_tags[i]); found = true;