Commit 4822bb3e authored by Philippe Teuwen's avatar Philippe Teuwen

Fix bug introduced in some signal traps where context was not declared

parent 03bc30f1
......@@ -49,6 +49,7 @@
#define MAX_FRAME_LEN 264
static nfc_device *pnd;
static nfc_context *context;
static void stop_dep_communication(int sig)
{
......@@ -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)");
......
......@@ -48,6 +48,7 @@
#define MAX_FRAME_LEN 264
static nfc_device *pnd;
static nfc_context *context;
static void stop_dep_communication(int sig)
{
......@@ -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)");
......
......@@ -74,6 +74,7 @@
#include "utils/nfc-utils.h"
static nfc_device *pnd;
static nfc_context *context;
static void
stop_emulation(int sig)
......@@ -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)");
......
......@@ -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 };
......@@ -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)");
......
......@@ -52,6 +52,7 @@
#define MAX_DEVICE_COUNT 16
static nfc_device *pnd = NULL;
static nfc_context *context;
static void stop_polling(int sig)
{
......@@ -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)");
......
......@@ -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;
......@@ -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");
......
......@@ -60,6 +60,7 @@
#endif
static nfc_device *pnd;
static nfc_context *context;
static void
print_usage(char *progname)
......@@ -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");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment