mirror of
https://github.com/nfc-tools/libnfc.git
synced 2026-03-10 17:43:49 +00:00
nfc_init() return rather than exit on malloc error, examples fixed accordingly
This commit is contained in:
@@ -85,6 +85,10 @@ int main(int argc, const char *argv[])
|
||||
|
||||
nfc_context *context;
|
||||
nfc_init(&context);
|
||||
if (context == NULL) {
|
||||
ERR("Unable to init libnfc (malloc)");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
// Try to open the NFC reader
|
||||
pnd = nfc_open(context, NULL);
|
||||
|
||||
Reference in New Issue
Block a user