Skip to content

Commit

Permalink
nfc-eventd: fixes issue 110, thanks Oleksii for the patch
Browse files Browse the repository at this point in the history
git-svn-id: https://nfc-tools.googlecode.com/svn/trunk/nfc-eventd@1126 ba5c3050-9c55-11de-a262-85a698460a8e
  • Loading branch information
doegox committed Apr 7, 2015
1 parent 21e0bcf commit 7c42a2d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/nfc-eventd.c
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ ned_poll_for_tag(nfc_device* nfc_device, nfc_target* tag)

int
main ( int argc, char *argv[] ) {
nfc_context* context;
nfc_target* old_tag = NULL;
nfc_target* new_tag;

Expand Down Expand Up @@ -372,9 +373,9 @@ main ( int argc, char *argv[] ) {
nfc_device* nfc_device = NULL;

//connect:
nfc_init(NULL);
nfc_init(&context);
// Try to open the NFC device
if ( nfc_device == NULL ) nfc_device = nfc_open( NULL, NULL );
if ( nfc_device == NULL ) nfc_device = nfc_open( context, NULL );
//init:
if ( nfc_device == NULL ) {
ERR( "%s", "NFC device not found" );
Expand Down Expand Up @@ -432,7 +433,7 @@ main ( int argc, char *argv[] ) {

/* If we get here means that an error or exit status occurred */
DBG ( "%s", "Exited from main loop" );
nfc_exit(NULL);
nfc_exit(context);
exit ( EXIT_FAILURE );
} /* main */

0 comments on commit 7c42a2d

Please sign in to comment.