libevdev_is_event_type() needs to check for < EV_CNT

EV_MAX is a valid (though unused) value.

Reported-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2013-08-29 11:17:08 +10:00
parent ce7e2f1516
commit fed9963973

View file

@ -1166,7 +1166,7 @@ libevdev_grab(struct libevdev *dev, enum libevdev_grab_mode grab)
int
libevdev_is_event_type(const struct input_event *ev, unsigned int type)
{
return type < EV_MAX && ev->type == type;
return type < EV_CNT && ev->type == type;
}
int