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>
This commit is contained in:
Matthieu Herrb 2011-04-01 22:51:48 +02:00
parent f9834d312e
commit 81257377a2

View File

@ -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);