From ecc12d28aabb7114956fc039d6980c02f7dda076 Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Tue, 12 Mar 2013 17:43:46 +0100 Subject: [PATCH] quick_start_example1.c: avoid using warnx() to remove err.h dependency err.h is not available under Windows and the goal of this example is not to learn how to get around that problem ;) --- ChangeLog | 1 + examples/doc/quick_start_example1.c | 9 ++------- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 06375ee..412c0df 100644 --- a/ChangeLog +++ b/ChangeLog @@ -29,6 +29,7 @@ Improvements: - Windows: logging via OutputDebugString(), ease debugging - nfc-mfclassic: use smaller files for cards < 4k - nfc-mfclassic: by defaut don't authorise wrong keyfile, use "f" to force + - quick_start_example1.c: remove err.h dependency, easier for Windowsians Changes: - Upon malloc error, nfc_init() doesn't force exit() anymore diff --git a/examples/doc/quick_start_example1.c b/examples/doc/quick_start_example1.c index 59cf06d..0c7b620 100644 --- a/examples/doc/quick_start_example1.c +++ b/examples/doc/quick_start_example1.c @@ -6,12 +6,7 @@ // To compile this simple example: // $ gcc -o quick_start_example1 quick_start_example1.c -lnfc -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif // HAVE_CONFIG_H - #include -#include #include static void @@ -37,7 +32,7 @@ main(int argc, const char *argv[]) // Initialize libnfc and set the nfc_context nfc_init(&context); if (context == NULL) { - warnx("Unable to init libnfc (malloc)\n"); + printf("Unable to init libnfc (malloc)\n"); exit(EXIT_FAILURE); } @@ -53,7 +48,7 @@ main(int argc, const char *argv[]) pnd = nfc_open(context, NULL); if (pnd == NULL) { - warnx("ERROR: %s", "Unable to open NFC device."); + printf("ERROR: %s", "Unable to open NFC device."); exit(EXIT_FAILURE); } // Set opened NFC device to initiator mode