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
VL-80 2022-01-30 14:10:03 -05:00 committed by Olivier Martin
parent c2c6b2f17b
commit 5b8893c647
1 changed files with 1 additions and 1 deletions

View File

@ -72,7 +72,7 @@ int gattlib_adapter_open(const char* adapter_name, void** adapter) {
}
*device_desc = hci_open_dev(dev_id);
if (device_desc < 0) {
if (*device_desc < 0) {
fprintf(stderr, "ERROR: Could not open device.\n");
return GATTLIB_DEVICE_ERROR;
}