xkb: fix virtual modmap size computation

Compute virtual modmap size bounded by nVModMapKeys-1, rather than
nVModMapKeys.

This is sort of a best guess.  The other way seems a little more
logical, but also leads to segfaults pretty quickly if you hammer
GetMap hard enough.  So let's try this one.
This commit is contained in:
Daniel Stone 2006-10-16 00:22:00 +03:00 committed by Daniel Stone
parent a484ba1527
commit 6dd4fc4652

View File

@ -1325,7 +1325,7 @@ unsigned short * pMap;
wire= (xkbVModMapWireDesc *)buf;
pMap= &xkb->server->vmodmap[rep->firstVModMapKey];
for (i=0;i<rep->nVModMapKeys;i++,pMap++) {
for (i=0;i<rep->nVModMapKeys-1;i++,pMap++) {
if (*pMap!=0) {
wire->key= i+rep->firstVModMapKey;
wire->vmods= *pMap;