xkb: don't replicate past the number of groups we have.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2008-12-02 15:36:51 +10:00 committed by Peter Hutterer
parent a157575eee
commit 70a977c021

View File

@ -524,7 +524,7 @@ int maxNumberOfGroups;
*/
if (nGroups == 1)
{
int idx;
int idx, j;
groupWidth = XkbKeyGroupWidth(xkb, key, XkbGroup1Index);
@ -547,8 +547,9 @@ int maxNumberOfGroups;
if (idx < 4)
idx = 4;
/* 3 or more groups: ABABCDECDEABCDEABCDE */
for (n = 0; n < groupWidth && idx < maxSymsPerKey; n++)
pCore[idx++] = pXKB[n];
for (j = 3; j <= maxNumberOfGroups; j++)
for (n = 0; n < groupWidth && idx < maxSymsPerKey; n++)
pCore[idx++] = pXKB[n];
}
pXKB+= XkbKeyGroupsWidth(xkb,key);