aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/Xi/xiquerydevice.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2010-04-22 08:57:22 +0000
committermarha <marha@users.sourceforge.net>2010-04-22 08:57:22 +0000
commitd2bf55b405ea8f980984aab4be7d4b878c9e6981 (patch)
tree676ad441e287f6de1950260c3d2ef0b720f69bad /xorg-server/Xi/xiquerydevice.c
parenta46e26df6103fb0e6e00d8d11d58c3f7a358208c (diff)
downloadvcxsrv-d2bf55b405ea8f980984aab4be7d4b878c9e6981.tar.gz
vcxsrv-d2bf55b405ea8f980984aab4be7d4b878c9e6981.tar.bz2
vcxsrv-d2bf55b405ea8f980984aab4be7d4b878c9e6981.zip
git update 22/4/2010
Diffstat (limited to 'xorg-server/Xi/xiquerydevice.c')
-rw-r--r--xorg-server/Xi/xiquerydevice.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/xorg-server/Xi/xiquerydevice.c b/xorg-server/Xi/xiquerydevice.c
index 435868de2..47ab688fd 100644
--- a/xorg-server/Xi/xiquerydevice.c
+++ b/xorg-server/Xi/xiquerydevice.c
@@ -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);