summaryrefslogtreecommitdiff
path: root/xkb/xkbUtils.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@redhat.com>2008-12-02 15:36:51 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2008-12-23 09:02:28 +1000
commit70a977c021e107c4fabe46ec2f619be9fb55abeb (patch)
treee2054342ac0c43d5e1cf5ec37d08ef217cce3931 /xkb/xkbUtils.c
parenta157575eeeb523cd43197c5caeb00cb3d56f9988 (diff)
xkb: don't replicate past the number of groups we have.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'xkb/xkbUtils.c')
-rw-r--r--xkb/xkbUtils.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/xkb/xkbUtils.c b/xkb/xkbUtils.c
index f13d292bd..7c39bcc93 100644
--- a/xkb/xkbUtils.c
+++ b/xkb/xkbUtils.c
@@ -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);