Avoid under-allocation of array for syncing key/led state

No functional effect as the size would end up being the same anyway
due to the values of KEY_MAX and LED_MAX.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
This commit is contained in:
Peter Hutterer 2013-08-27 08:03:17 +10:00
parent 4123927cf0
commit 8b435a8534

View file

@ -302,7 +302,7 @@ sync_key_state(struct libevdev *dev)
{
int rc;
int i;
unsigned long keystate[NLONGS(KEY_MAX)];
unsigned long keystate[NLONGS(KEY_CNT)];
rc = ioctl(dev->fd, EVIOCGKEY(sizeof(keystate)), keystate);
if (rc < 0)
@ -329,7 +329,7 @@ sync_led_state(struct libevdev *dev)
{
int rc;
int i;
unsigned long ledstate[NLONGS(LED_MAX)];
unsigned long ledstate[NLONGS(LED_CNT)];
rc = ioctl(dev->fd, EVIOCGLED(sizeof(ledstate)), ledstate);
if (rc < 0)