From 2c7cd6df986707b933bd02e705208797275abaa5 Mon Sep 17 00:00:00 2001 From: Carter Li Date: Sun, 28 Jul 2024 10:54:49 +0800 Subject: [PATCH] Bluetooth (Linux): more strict checks --- src/detection/bluetooth/bluetooth_linux.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/detection/bluetooth/bluetooth_linux.c b/src/detection/bluetooth/bluetooth_linux.c index 0ac664d7a..ef66cfcc3 100644 --- a/src/detection/bluetooth/bluetooth_linux.c +++ b/src/detection/bluetooth/bluetooth_linux.c @@ -86,8 +86,8 @@ static void detectBluetoothProperty(FFDBusData* dbus, DBusMessageIter* iter, FFB const char* propertyType; dbus->lib->ffdbus_message_iter_get_basic(&dictIter, &propertyType); - if(strstr(propertyType, "Device") == NULL && strstr(propertyType, "Battery") == NULL) - return; //We don't care about other properties + if(!ffStrContains(propertyType, ".Device") && !ffStrContains(propertyType, ".Battery")) + return; // We don't care about other properties dbus->lib->ffdbus_message_iter_next(&dictIter); @@ -118,8 +118,8 @@ static void detectBluetoothObject(FFlist* devices, FFDBusData* dbus, DBusMessage const char* objectPath; dbus->lib->ffdbus_message_iter_get_basic(&dictIter, &objectPath); - //We don't want adapter objects - if(strstr(objectPath, "dev_") == NULL) + // We don't want adapter objects + if(!ffStrContains(objectPath, "/dev_")) return; dbus->lib->ffdbus_message_iter_next(&dictIter);