evdev: Fix uninitialized variable

Due to a patch pushed accidentally to main, the `key_count` variable is
uninitialized in the `evdev_log_bug_libinput` code path:

  ../src/evdev.c:148:12: error: ‘key_count’ may be used uninitialized [-Werror=maybe-uninitialized]
    148 |         if (key_count > 32) {
        |            ^
  ../src/evdev.c: In function ‘evdev_pointer_post_button’:
  ../src/evdev.c:132:13: note: ‘key_count’ was declared here
    132 |         int key_count;
        |             ^~~~~~~~~

Fixes commit bb1e4a493f ("evdev: Log bug when releasing key with count 0")
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
This commit is contained in:
José Expósito 2023-09-01 09:49:31 +02:00
parent bb1e4a493f
commit bf59231f23

View file

@ -129,7 +129,7 @@ evdev_update_key_down_count(struct evdev_device *device,
int code,
int pressed)
{
int key_count;
int key_count = 0;
assert(code >= 0 && code < KEY_CNT);
if (pressed) {