udev: use startswith() instead of the combination of strneq() and strlen() (#8459)
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 16 Mar 2018 09:29:57 +0000 (18:29 +0900)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 16 Mar 2018 09:29:57 +0000 (10:29 +0100)
src/udev/scsi_id/scsi_id.c

index 32c1a8d..63d2756 100644 (file)
@@ -259,9 +259,8 @@ static int get_file_options(struct udev *udev,
                         if (vendor_in == NULL)
                                 break;
                 } else if (vendor_in &&
-                           strneq(vendor, vendor_in, strlen(vendor_in)) &&
-                           (!model_in ||
-                            (strneq(model, model_in, strlen(model_in))))) {
+                           startswith(vendor, vendor_in) &&
+                           (!model_in || startswith(model, model_in))) {
                                 /*
                                  * Matched vendor and optionally model.
                                  *