mirror of https://github.com/labapart/gattlib
bluez/gattlib_adapter.c: Fix bug
The checking of the result of the hci_open_dev() function needs to be done on the derefenced value, not the pointer (which can not be negative).pull/248/head
parent
c2c6b2f17b
commit
5b8893c647
|
@ -72,7 +72,7 @@ int gattlib_adapter_open(const char* adapter_name, void** adapter) {
|
||||||
}
|
}
|
||||||
|
|
||||||
*device_desc = hci_open_dev(dev_id);
|
*device_desc = hci_open_dev(dev_id);
|
||||||
if (device_desc < 0) {
|
if (*device_desc < 0) {
|
||||||
fprintf(stderr, "ERROR: Could not open device.\n");
|
fprintf(stderr, "ERROR: Could not open device.\n");
|
||||||
return GATTLIB_DEVICE_ERROR;
|
return GATTLIB_DEVICE_ERROR;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue