Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplification of conditions #463

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions libnfc/target-subr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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: ");
Expand Down Expand Up @@ -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: ");
Expand Down Expand Up @@ -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");
Expand Down