summaryrefslogtreecommitdiff
path: root/Xi
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu.herrb@laas.fr>2011-04-01 22:51:48 +0200
committerMatthieu Herrb <matthieu.herrb@laas.fr>2011-04-02 09:14:23 +0200
commit81257377a2d011ce47fba5822df0f7918dea1d72 (patch)
tree15788eeb58222e14ed24b1dd5ce8b13891117457 /Xi
parentf9834d312e3059073e8ad77d9f9d57cb9d96e1e5 (diff)
Xi: take XI2 requests into account also for the swapping case.
Signed-off-by: Matthieu Herrb <matthieu.herrb@laas.fr> Reviewed-by: Julien Cristau <jcristau@debian.org>
Diffstat (limited to 'Xi')
-rw-r--r--Xi/extinit.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Xi/extinit.c b/Xi/extinit.c
index 46d34599c..289558fae 100644
--- a/Xi/extinit.c
+++ b/Xi/extinit.c
@@ -49,6 +49,7 @@ SOFTWARE.
* Dispatch routines and initialization routines for the X input extension.
*
*/
+#define ARRAY_SIZE(_a) (sizeof((_a)) / sizeof((_a)[0]))
#define NUMTYPES 15
@@ -410,7 +411,7 @@ static int
ProcIDispatch(ClientPtr client)
{
REQUEST(xReq);
- if (stuff->data > (IREQUESTS + XI2REQUESTS) || !ProcIVector[stuff->data])
+ if (stuff->data > ARRAY_SIZE(ProcIVector) || !ProcIVector[stuff->data])
return BadRequest;
return (*ProcIVector[stuff->data])(client);
@@ -429,7 +430,7 @@ static int
SProcIDispatch(ClientPtr client)
{
REQUEST(xReq);
- if (stuff->data > IREQUESTS || !SProcIVector[stuff->data])
+ if (stuff->data > ARRAY_SIZE(SProcIVector) || !SProcIVector[stuff->data])
return BadRequest;
return (*SProcIVector[stuff->data])(client);