From 1e28b5e4b3b211ff7a138a65cacfcaddc79de1b7 Mon Sep 17 00:00:00 2001 From: Roman Kalashnikov Date: Sat, 28 Oct 2017 02:20:18 +0300 Subject: [PATCH] Simplification of conditions --- libnfc/target-subr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libnfc/target-subr.c b/libnfc/target-subr.c index 97e2882b..ce28eb52 100644 --- a/libnfc/target-subr.c +++ b/libnfc/target-subr.c @@ -279,7 +279,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, " 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]; offset++; off += snprintf(dst + off, size - off, " * Chip Type: "); @@ -322,7 +322,7 @@ snprint_nfc_iso14443a_info(char *dst, size_t size, const nfc_iso14443a_info *pna break; } } - if ((pnai->szAtsLen - offset) > 0) { // Omit 2 CRC bytes + if (pnai->szAtsLen != offset) { // Omit 2 CRC bytes uint8_t CVC = pnai->abtAts[offset]; offset++; off += snprintf(dst + off, size - off, " * Chip Status: "); @@ -356,7 +356,7 @@ snprint_nfc_iso14443a_info(char *dst, size_t size, const nfc_iso14443a_info *pna break; } } - if ((pnai->szAtsLen - offset) > 0) { // Omit 2 CRC bytes + if (pnai->szAtsLen != offset) { // Omit 2 CRC bytes uint8_t VCS = pnai->abtAts[offset]; offset++; off += snprintf(dst + off, size - off, " * Specifics (Virtual Card Selection):\n");