Merge 1e28b5e4b3b211ff7a138a65cacfcaddc79de1b7 into 42de50f2b7bd4c43e3b92f5c9d6a996fd5300e4f

This commit is contained in:
Roman Kalashnikov 2023-03-14 08:15:18 +09:00 committed by GitHub
commit 22f72a0720
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -280,7 +280,7 @@ snprint_nfc_iso14443a_info(char *dst, size_t size, const nfc_iso14443a_info *pna
off += snprintf(dst + off, size - off, " * Warning: Type Identification Coding length (%i)", L); off += snprintf(dst + off, size - off, " * Warning: Type Identification Coding length (%i)", L);
off += snprintf(dst + off, size - off, " not matching Tk length (%" PRIdPTR ")\n", (pnai->szAtsLen - offset)); off += snprintf(dst + off, size - off, " not matching Tk length (%" PRIdPTR ")\n", (pnai->szAtsLen - offset));
} }
if ((pnai->szAtsLen - offset - 2) > 0) { // Omit 2 CRC bytes if ((pnai->szAtsLen - offset) != 2) { // Omit 2 CRC bytes
uint8_t CTC = pnai->abtAts[offset]; uint8_t CTC = pnai->abtAts[offset];
offset++; offset++;
off += snprintf(dst + off, size - off, " * Chip Type: "); off += snprintf(dst + off, size - off, " * Chip Type: ");
@ -323,7 +323,7 @@ snprint_nfc_iso14443a_info(char *dst, size_t size, const nfc_iso14443a_info *pna
break; break;
} }
} }
if ((pnai->szAtsLen - offset) > 0) { // Omit 2 CRC bytes if (pnai->szAtsLen != offset) { // Omit 2 CRC bytes
uint8_t CVC = pnai->abtAts[offset]; uint8_t CVC = pnai->abtAts[offset];
offset++; offset++;
off += snprintf(dst + off, size - off, " * Chip Status: "); off += snprintf(dst + off, size - off, " * Chip Status: ");
@ -357,7 +357,7 @@ snprint_nfc_iso14443a_info(char *dst, size_t size, const nfc_iso14443a_info *pna
break; break;
} }
} }
if ((pnai->szAtsLen - offset) > 0) { // Omit 2 CRC bytes if (pnai->szAtsLen != offset) { // Omit 2 CRC bytes
uint8_t VCS = pnai->abtAts[offset]; uint8_t VCS = pnai->abtAts[offset];
offset++; offset++;
off += snprintf(dst + off, size - off, " * Specifics (Virtual Card Selection):\n"); off += snprintf(dst + off, size - off, " * Specifics (Virtual Card Selection):\n");