error handling
This commit is contained in:
parent
f2677da74c
commit
6fb61d3c1e
1 changed files with 9 additions and 1 deletions
|
@ -822,9 +822,17 @@ main(int argc, const char *argv[])
|
||||||
}
|
}
|
||||||
printf("Done.\n");
|
printf("Done.\n");
|
||||||
fclose(pfDump);
|
fclose(pfDump);
|
||||||
|
} else {
|
||||||
|
nfc_close(pnd);
|
||||||
|
nfc_exit(context);
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
} else if (atAction == ACTION_WRITE) {
|
} else if (atAction == ACTION_WRITE) {
|
||||||
write_card(unlock);
|
if (!write_card(unlock)) {
|
||||||
|
nfc_close(pnd);
|
||||||
|
nfc_exit(context);
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
nfc_close(pnd);
|
nfc_close(pnd);
|
||||||
|
|
Loading…
Reference in a new issue