Skip to content

Commit

Permalink
Fix bug introduced in some signal traps where context was not declared
Browse files Browse the repository at this point in the history
  • Loading branch information
doegox committed Mar 5, 2013
1 parent 03bc30f commit 4822bb3
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion examples/nfc-dep-initiator.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
#define MAX_FRAME_LEN 264

static nfc_device *pnd;
static nfc_context *context;

static void stop_dep_communication(int sig)
{
Expand All @@ -73,7 +74,6 @@ main(int argc, const char *argv[])
exit(EXIT_FAILURE);
}

nfc_context *context;
nfc_init(&context);
if (context == NULL) {
ERR("Unable to init libnfc (malloc)");
Expand Down
2 changes: 1 addition & 1 deletion examples/nfc-dep-target.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
#define MAX_FRAME_LEN 264

static nfc_device *pnd;
static nfc_context *context;

static void stop_dep_communication(int sig)
{
Expand All @@ -72,7 +73,6 @@ main(int argc, const char *argv[])
exit(EXIT_FAILURE);
}

nfc_context *context;
nfc_init(&context);
if (context == NULL) {
ERR("Unable to init libnfc (malloc)");
Expand Down
2 changes: 1 addition & 1 deletion examples/nfc-emulate-forum-tag2.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
#include "utils/nfc-utils.h"

static nfc_device *pnd;
static nfc_context *context;

static void
stop_emulation(int sig)
Expand Down Expand Up @@ -186,7 +187,6 @@ main(int argc, char *argv[])

signal(SIGINT, stop_emulation);

nfc_context *context;
nfc_init(&context);
if (context == NULL) {
ERR("Unable to init libnfc (malloc)");
Expand Down
2 changes: 1 addition & 1 deletion examples/nfc-emulate-uid.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
static uint8_t abtRecv[MAX_FRAME_LEN];
static int szRecvBits;
static nfc_device *pnd;
static nfc_context *context;

// ISO14443A Anti-Collision response
uint8_t abtAtqa[2] = { 0x04, 0x00 };
Expand Down Expand Up @@ -126,7 +127,6 @@ main(int argc, char *argv[])
signal(SIGINT, intr_hdlr);
#endif

nfc_context *context;
nfc_init(&context);
if (context == NULL) {
ERR("Unable to init libnfc (malloc)");
Expand Down
2 changes: 1 addition & 1 deletion examples/nfc-poll.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
#define MAX_DEVICE_COUNT 16

static nfc_device *pnd = NULL;
static nfc_context *context;

static void stop_polling(int sig)
{
Expand Down Expand Up @@ -105,7 +106,6 @@ main(int argc, const char *argv[])
nfc_target nt;
int res = 0;

nfc_context *context;
nfc_init(&context);
if (context == NULL) {
ERR("Unable to init libnfc (malloc)");
Expand Down
2 changes: 1 addition & 1 deletion utils/nfc-emulate-forum-tag4.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
#include "nfc-utils.h"

static nfc_device *pnd;
static nfc_context *context;
static bool quiet_output = false;
// Version of the emulated type4 tag:
static int type4v = 2;
Expand Down Expand Up @@ -380,7 +381,6 @@ main(int argc, char *argv[])
}
}

nfc_context *context;
nfc_init(&context);
if (context == NULL) {
ERR("Unable to init libnfc (malloc)\n");
Expand Down
2 changes: 1 addition & 1 deletion utils/nfc-read-forum-tag3.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
#endif

static nfc_device *pnd;
static nfc_context *context;

static void
print_usage(char *progname)
Expand Down Expand Up @@ -198,7 +199,6 @@ main(int argc, char *argv[])
}
}

nfc_context *context;
nfc_init(&context);
if (context == NULL) {
ERR("Unable to init libnfc (malloc)\n");
Expand Down

0 comments on commit 4822bb3

Please sign in to comment.