mirror of
https://github.com/nfc-tools/libnfc.git
synced 2026-03-12 18:43:47 +00:00
nfc_init() return rather than exit on malloc error, examples fixed accordingly
This commit is contained in:
@@ -69,6 +69,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);
|
||||
}
|
||||
|
||||
// Display libnfc version
|
||||
acLibnfcVersion = nfc_version();
|
||||
|
||||
Reference in New Issue
Block a user