mirror of
https://gitlab.freedesktop.org/libevdev/libevdev.git
synced 2025-12-24 13:30:06 +01:00
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:
parent
4123927cf0
commit
8b435a8534
1 changed files with 2 additions and 2 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue