autopair: Fix compiler warning
authorSonny Sasaka <sonnysasaka@chromium.org>
Tue, 24 Mar 2020 19:49:42 +0000 (12:49 -0700)
committerAyush Garg <ayush.garg@samsung.com>
Mon, 12 Apr 2021 09:00:48 +0000 (14:30 +0530)
With clang, comparing an array with NULL generates a warning because the
value is always non-NULL. With maintainer mode enabled, this becomes a
compilation error.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
plugins/autopair.c

index 043bd9b..3089430 100755 (executable)
@@ -75,7 +75,7 @@ static ssize_t autopair_pincb(struct btd_adapter *adapter,
                btd_device_get_product (device));
 
        /* The iCade shouldn't use random PINs like normal keyboards */
-       if (name != NULL && strstr(name, "iCade") != NULL)
+       if (strstr(name, "iCade") != NULL)
                return 0;
 
        /* This is a class-based pincode guesser. Ignore devices with an