summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/evdev_btn.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/evdev_btn.c b/src/evdev_btn.c
index cc279ff..9a2c2cf 100644
--- a/src/evdev_btn.c
+++ b/src/evdev_btn.c
@@ -87,9 +87,9 @@ EvdevBtnInit (DeviceIntPtr device)
if (!pEvdev->state.buttons)
return Success;
- map = Xcalloc (sizeof (CARD8) * pEvdev->state.buttons);
+ map = Xcalloc (sizeof (CARD8) * (pEvdev->state.buttons + 1));
- for (i = 0; i < pEvdev->state.buttons; i++)
+ for (i = 0; i <= pEvdev->state.buttons; i++)
map[i] = i;
xf86Msg(X_ERROR, "%s (%d): Registering %d buttons.\n", __FILE__, __LINE__,