From 6ab3c368b8cc05a001bdc5bde1cb588f283533d8 Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Tue, 4 Mar 2014 01:41:01 +0100 Subject: [PATCH] nfc-emulate-uid: remove unreachable code and add proper cleaning when interrupted --- examples/nfc-emulate-uid.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/nfc-emulate-uid.c b/examples/nfc-emulate-uid.c index a744e51..690388e 100644 --- a/examples/nfc-emulate-uid.c +++ b/examples/nfc-emulate-uid.c @@ -79,7 +79,10 @@ intr_hdlr(int sig) if (pnd != NULL) { printf("\nAborting current command...\n"); nfc_abort_command(pnd); + nfc_close(pnd); } + nfc_exit(context); + exit(EXIT_SUCCESS); } static void @@ -237,7 +240,4 @@ main(int argc, char *argv[]) } } } - nfc_close(pnd); - nfc_exit(context); - exit(EXIT_SUCCESS); }