diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2010-12-05 15:36:12 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2010-12-05 15:36:12 +0000 |
commit | a90ee792d96752ad1b71b9ada922fa6afe478c99 (patch) | |
tree | 6143b00f7646951d23dfe2a4fe2992ca40b77069 /xserver/Xi/xiquerydevice.c | |
parent | bc97d4ecc0aa9e1b823565b07282f848700bd11a (diff) |
Upgrade to xorg-server 1.9.2.
Tested by ajacoutot@, krw@, shadchin@ and jasper@ on various configurations
including multihead with both zaphod and xrandr.
Diffstat (limited to 'xserver/Xi/xiquerydevice.c')
-rw-r--r-- | xserver/Xi/xiquerydevice.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/xserver/Xi/xiquerydevice.c b/xserver/Xi/xiquerydevice.c index 435868de2..303c8b27d 100644 --- a/xserver/Xi/xiquerydevice.c +++ b/xserver/Xi/xiquerydevice.c @@ -87,7 +87,7 @@ ProcXIQueryDevice(ClientPtr client) } else { - skip = xcalloc(sizeof(Bool), inputInfo.numDevices); + skip = calloc(sizeof(Bool), inputInfo.numDevices); if (!skip) return BadAlloc; @@ -106,7 +106,7 @@ ProcXIQueryDevice(ClientPtr client) } } - info = xcalloc(1, len); + info = calloc(1, len); if (!info) return BadAlloc; @@ -155,8 +155,8 @@ ProcXIQueryDevice(ClientPtr client) WriteReplyToClient(client, sizeof(xXIQueryDeviceReply), &rep); WriteToClient(client, rep.length * 4, ptr); - xfree(ptr); - xfree(skip); + free(ptr); + free(skip); return rc; } @@ -247,6 +247,9 @@ ListButtonInfo(DeviceIntPtr dev, xXIButtonInfo* info, Bool reportState) int mask_len; int i; + if (!dev || !dev->button) + return 0; + mask_len = bytes_to_int32(bits_to_bytes(dev->button->numButtons)); info->type = ButtonClass; @@ -259,7 +262,7 @@ ListButtonInfo(DeviceIntPtr dev, xXIButtonInfo* info, Bool reportState) memset(bits, 0, mask_len * 4); if (reportState) - for (i = 0; dev && dev->button && i < dev->button->numButtons; i++) + for (i = 0; i < dev->button->numButtons; i++) if (BitIsOn(dev->button->down, i)) SetBit(bits, i); |