From 1db1c053d1cf6e4b4be8e31d9066a9b0c42f1c75 Mon Sep 17 00:00:00 2001 From: Frederik Aalund Date: Wed, 12 Aug 2020 16:55:39 +0200 Subject: [PATCH] Fix off-by-one in ioctl_EVIOCG_bits This bug caused values at the end of the list to not be reported back. Example: On my system, SW_PEN_INSERTED (0x0f) is the last switch constant. That is, SW_MAX=SW_PEN_INSERTED. Other tools (python-libevdev) correctly reported this switch as 'set' but python-evdev did not. This commit fixes this issue. --- evdev/input.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/evdev/input.c b/evdev/input.c index b09102b..0a7b0d0 100644 --- a/evdev/input.c +++ b/evdev/input.c @@ -413,7 +413,7 @@ ioctl_EVIOCG_bits(PyObject *self, PyObject *args) return NULL; PyObject* res = PyList_New(0); - for (int i=0; i