Skip to content

Commit

Permalink
Fix some compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviermartin committed Mar 7, 2024
1 parent 6e71825 commit e26e9f0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions dbus/gattlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ void get_device_path_from_mac_with_adapter(OrgBluezAdapter1* adapter, const char

// Transform string from 'DA:94:40:95:E0:87' to 'dev_DA_94_40_95_E0_87'
strncpy(device_address_str, mac_address, sizeof(device_address_str) - 1);
for (int i = 0; i < strlen(device_address_str); i++) {
for (size_t i = 0; i < strlen(device_address_str); i++) {
if (device_address_str[i] == ':') {
device_address_str[i] = '_';
}
Expand All @@ -112,7 +112,7 @@ void get_device_path_from_mac(const char *adapter_name, const char *mac_address,

// Transform string from 'DA:94:40:95:E0:87' to 'dev_DA_94_40_95_E0_87'
strncpy(device_address_str, mac_address, sizeof(device_address_str) - 1);
for (int i = 0; i < strlen(device_address_str); i++) {
for (size_t i = 0; i < strlen(device_address_str); i++) {
if (device_address_str[i] == ':') {
device_address_str[i] = '_';
}
Expand Down
2 changes: 1 addition & 1 deletion dbus/gattlib_adapter.c
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ int gattlib_adapter_scan_disable(void* adapter) {

org_bluez_adapter1_call_stop_discovery_sync(gattlib_adapter->adapter_proxy, NULL, &error);
if (error != NULL) {
if ((error->domain == 238) && (error->code == 36)) {
if (((error->domain == 238) || (error->domain == 239)) && (error->code == 36)) {
// Correspond to error: GDBus.Error:org.bluez.Error.Failed: No discovery started
goto EXIT;
} else {
Expand Down

0 comments on commit e26e9f0

Please sign in to comment.