Skip to content

Commit

Permalink
main.c: fix logic to check retry_admin and retry_user if res diff of …
Browse files Browse the repository at this point in the history
…RET_NO_PIN_ATTEMPTS otherwise going into else and showing bad output

Signed-off-by: Thierry Laurion <[email protected]>
  • Loading branch information
tlaurion committed Apr 16, 2024
1 parent 70c04f5 commit 82afedf
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ void print_card_serial(struct ResponseStatus *status) {
printf("N/A\n");
}
}

int parse_cmd_and_run(int argc, char *const *argv) {
int res = RET_INVALID_PARAMS;
if (argc > 1) {
Expand All @@ -107,7 +106,7 @@ int parse_cmd_and_run(int argc, char *const *argv) {
printf("\tFirmware: v%d.%d\n",
status.firmware_version_st.major,
status.firmware_version_st.minor);
if (res != RET_NO_PIN_ATTEMPTS) {
if (res != RET_NO_PIN_ATTEMPTS && status.retry_admin != -1 && status.retry_user != -1) {
printf("\tCard counters: Admin %d, User %d\n",
status.retry_admin, status.retry_user);
} else {
Expand Down

0 comments on commit 82afedf

Please sign in to comment.