From 371a0e3ee002b0cf5d779547742cda87f114b988 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Thu, 10 Oct 2019 11:13:14 +0200 Subject: [PATCH] coverity 226308 --- client/cmdhflist.c | 2 +- include/protocols.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client/cmdhflist.c b/client/cmdhflist.c index 45abd1d57..737405787 100644 --- a/client/cmdhflist.c +++ b/client/cmdhflist.c @@ -363,7 +363,7 @@ void annotateIclass(char *exp, size_t size, uint8_t *cmd, uint8_t cmdsize) { snprintf(exp, size, "UPDATE(%d)", cmd[1]); break; case ICLASS_CMD_READCHECK: - if (ICLASS_CREDIT(c)) { + if (ICLASS_CREDIT(cmd[0])) { snprintf(exp, size, "READCHECK[Kc](%d)", cmd[1]); } else { snprintf(exp, size, "READCHECK[Kd](%d)", cmd[1]); diff --git a/include/protocols.h b/include/protocols.h index 4eb3ab58c..2547f01de 100644 --- a/include/protocols.h +++ b/include/protocols.h @@ -133,8 +133,8 @@ ISO 7816-4 Basic interindustry commands. For command APDU's. #define ICLASS_CMD_READ_OR_IDENTIFY 0xC #define ICLASS_CMD_ACT 0xE -#define ICLASS_CREDIT(x) (((x) & 0x5) == 0x5) -#define ICLASS_DEBIT(x) (((x) & 0x5) == 0) +#define ICLASS_CREDIT(x) (((x) & 0x10) == 0x10) +#define ICLASS_DEBIT(x) !(ICLASS_CREDIT(x)) #define ISO14443A_CMD_REQA 0x26