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

main.c: fix logic causing "pin not set" false output, when set #31

Closed
wants to merge 1 commit into from
Closed
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
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
Loading