--- src/evdev.c~ 2005-09-23 18:32:23.000000000 -0400 +++ src/evdev.c 2006-01-16 13:28:15.000000000 -0500 @@ -465,7 +465,7 @@ static int EvdevAddButtonClass(DeviceIntPtr device) { - CARD8 map[32]; + CARD8 map[33]; InputInfoPtr pInfo; int i; @@ -473,7 +473,7 @@ /* FIXME: count number of actual buttons */ - for (i = 0; i < ArrayLength(map); i++) + for (i = 1; i < ArrayLength(map); i++) map[i] = i; /* Linux reports BTN_LEFT, BTN_RIGHT, BTN_MIDDLE, which should map @@ -481,7 +481,7 @@ map[2] = 3; map[3] = 2; - if (!InitButtonClassDeviceStruct(device, ArrayLength(map), map)) + if (!InitButtonClassDeviceStruct(device, ArrayLength(map)-1, map)) return !Success; pInfo->flags |= XI86_POINTER_CAPABLE | XI86_SEND_DRAG_EVENTS;