udev: use startswith() instead of the combination of strneq() and strlen() (#8459)

This commit is contained in:
Yu Watanabe 2018-03-16 18:29:57 +09:00 committed by Zbigniew Jędrzejewski-Szmek
parent 8eebb6a9e5
commit 0caa99466d

View 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.
*