1
0
forked from drath/libratbag

Use strneq instead of strncmp

Less error-prone

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer
2015-08-24 11:42:32 +10:00
parent d73d9f6023
commit 82338aadcd
2 changed files with 2 additions and 2 deletions

View File

@@ -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;
}

View File

@@ -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