Package: joystick
Version: 20051019-4
Tags: patch

When starting evtest with kernel 2.6.27-rc1+, the following
message appears in dmesg:
| evdev.c(EVIOCGBIT): Suspicious buffer size 511, limiting output to 64 bytes. 
See http://userweb.kernel.org/~dtor/eviocgbit-bug.html

The following patch fixes the issue. Btw: Upstream homepage
(http://linuxconsole.sourceforge.net/) is dead.

--- joystick-20051019.org/utils/evtest.c        2005-02-06 14:51:42.000000000 
+0100
+++ joystick-20051019/utils/evtest.c    2008-09-18 16:01:57.000000000 +0200
@@ -333,14 +333,14 @@
        printf("Input device name: \"%s\"\n", name);
 
        memset(bit, 0, sizeof(bit));
-       ioctl(fd, EVIOCGBIT(0, EV_MAX), bit[0]);
+       ioctl(fd, EVIOCGBIT(0, sizeof(bit[0])), bit[0]);
        printf("Supported events:\n");
 
        for (i = 0; i < EV_MAX; i++)
                if (test_bit(i, bit[0])) {
                        printf("  Event type %d (%s)\n", i, events[i] ? 
events[i] : "?");
                        if (!i) continue;
-                       ioctl(fd, EVIOCGBIT(i, KEY_MAX), bit[i]);
+                       ioctl(fd, EVIOCGBIT(i, sizeof(bit[0])), bit[i]);
                        for (j = 0; j < KEY_MAX; j++) 
                                if (test_bit(j, bit[i])) {
                                        printf("    Event code %d (%s)\n", j, 
names[i] ? (names[i][j] ? names[i][j] : "?") : "?");



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to