Skip to content

Commit

Permalink
error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
gelotus committed Jun 30, 2020
1 parent f2677da commit 6fb61d3
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion utils/nfc-mfclassic.c
Original file line number Diff line number Diff line change
Expand Up @@ -822,9 +822,17 @@ main(int argc, const char *argv[])
}
printf("Done.\n");
fclose(pfDump);
} else {
nfc_close(pnd);
nfc_exit(context);
exit(EXIT_FAILURE);
}
} else if (atAction == ACTION_WRITE) {
write_card(unlock);
if (!write_card(unlock)) {
nfc_close(pnd);
nfc_exit(context);
exit(EXIT_FAILURE);
}
}

nfc_close(pnd);
Expand Down

0 comments on commit 6fb61d3

Please sign in to comment.