nfc_init() return rather than exit on malloc error, examples fixed accordingly
This commit is contained in:
parent
ae6062e5ba
commit
73b5c9d0af
22 changed files with 92 additions and 9 deletions
|
|
@ -72,6 +72,10 @@ main(int argc, const char *argv[])
|
|||
|
||||
nfc_context *context;
|
||||
nfc_init(&context);
|
||||
if (context == NULL) {
|
||||
ERR("Unable to init libnfc (malloc)");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
#define MAX_DEVICE_COUNT 2
|
||||
nfc_connstring connstrings[MAX_DEVICE_COUNT];
|
||||
size_t szDeviceFound = nfc_list_devices(context, connstrings, MAX_DEVICE_COUNT);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue