From fbe111032e8092d5e031bf3a6f0cee6b9a20333e Mon Sep 17 00:00:00 2001 From: notaz Date: Sun, 20 Dec 2009 19:45:40 +0000 Subject: [PATCH] bugfixes git-svn-id: file:///home/notaz/opt/svn/PicoDrive/platform@844 be3aeb3a-fb24-0410-a615-afba39da0efa --- linux/in_evdev.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/linux/in_evdev.c b/linux/in_evdev.c index 7866015..df40368 100644 --- a/linux/in_evdev.c +++ b/linux/in_evdev.c @@ -126,11 +126,17 @@ static const char * const in_evdev_keys[KEY_CNT] = { static void in_evdev_probe(void) { + long keybits[KEY_CNT / sizeof(long) / 8]; + long absbits[(ABS_MAX+1) / sizeof(long) / 8]; int i; + // the kernel might support and return less keys then we know about, + // so make sure the buffers are clear. + memset(keybits, 0, sizeof(keybits)); + memset(absbits, 0, sizeof(absbits)); + for (i = 0;; i++) { - int keybits[KEY_CNT / sizeof(int)], absbits[(ABS_MAX+1)/sizeof(int)]; int support = 0, count = 0; in_evdev_t *dev; int u, ret, fd; -- 2.39.5