mirror of
https://github.com/libratbag/libratbag.git
synced 2026-11-07 23:23:52 +01:00
Use strneq instead of strncmp
Less error-prone Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
@@ -199,7 +199,7 @@ udev_find_hidraw(struct ratbag *ratbag, struct ratbag_device *device)
|
||||
continue;
|
||||
|
||||
sysname = udev_device_get_sysname(udev_device);
|
||||
if (strncmp("hidraw", sysname, 6) != 0) {
|
||||
if (!strneq("hidraw", sysname, 6)) {
|
||||
udev_device_unref(udev_device);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -525,7 +525,7 @@ static const struct ratbag_cmd cmd_change_button = {
|
||||
static int
|
||||
filter_event_node(const struct dirent *input_entry)
|
||||
{
|
||||
return !strncmp(input_entry->d_name, "event", 5);
|
||||
return strneq(input_entry->d_name, "event", 5);
|
||||
}
|
||||
|
||||
static int
|
||||
|
||||
Reference in New Issue
Block a user