Fix some compiler warnings

pull/185/merge 0.4.6
Olivier Martin 2024-03-07 08:53:42 +01:00
parent 6e718253b0
commit e26e9f0b7a
2 changed files with 3 additions and 3 deletions

View File

@ -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] = '_';
}
@ -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] = '_';
}

View File

@ -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 {