From 08070987440c903706cd36993ce6fdf2a928416d Mon Sep 17 00:00:00 2001 From: Merlijn Wajer Date: Thu, 25 Apr 2013 20:51:33 +0200 Subject: [PATCH] Fix compilation error. --- map.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/map.c b/map.c index 8bd7fbc..1442fe9 100644 --- a/map.c +++ b/map.c @@ -129,12 +129,14 @@ int scan_device(char *f, int nfd) { ioctl(fd, EVIOCGBIT(i, KEY_MAX), bit[i]); for (j = 0; j < KEY_MAX; j++) if (test_bit(j, bit[i])) { - long kbit; + long kbit = 0; switch (i) { case EV_KEY: kbit = UI_SET_KEYBIT; break; case EV_REL: kbit = UI_SET_RELBIT; break; case EV_ABS: kbit = UI_SET_ABSBIT; break; } + if (!kbit) + continue; printf("Setting key: %d\n", j); printf("ioctl: %d\n", ioctl(nfd, kbit, j));