mirror of
https://github.com/nfc-tools/libnfc.git
synced 2026-03-12 10:33:47 +00:00
nfc_init() return rather than exit on malloc error, examples fixed accordingly
This commit is contained in:
@@ -197,6 +197,10 @@ main(int argc, char *argv[])
|
||||
|
||||
nfc_context *context;
|
||||
nfc_init(&context);
|
||||
if (context == NULL) {
|
||||
ERR("Unable to init libnfc (malloc)");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
nfc_connstring connstrings[MAX_DEVICE_COUNT];
|
||||
// List available devices
|
||||
|
||||
Reference in New Issue
Block a user