keymap: don't use XKB_NUM_GROUPS for key->kt_index

One unneeded XKB_NUM_GROUPS less.

Signed-off-by: Ran Benita <ran234@gmail.com>
master
Ran Benita 2012-09-23 20:36:01 +02:00 committed by Daniel Stone
parent 9a18b87251
commit 7a90f9e225
3 changed files with 3 additions and 1 deletions

View File

@ -99,6 +99,7 @@ xkb_keymap_unref(struct xkb_keymap *keymap)
free(key->num_syms);
free(key->syms);
free(key->actions);
free(key->kt_index);
}
darray_free(keymap->keys);
darray_free(keymap->sym_interpret);

View File

@ -320,7 +320,7 @@ struct xkb_key {
union xkb_action *actions;
unsigned kt_index[XKB_NUM_GROUPS];
unsigned *kt_index;
xkb_layout_index_t num_groups;
/* How many levels the largest group has. */

View File

@ -1500,6 +1500,7 @@ out_of_loops:
* Find and assign the groups' types in the keymap. Also find the
* key width according to the largest type.
*/
key->kt_index = calloc(key->num_groups, sizeof(*key->kt_index));
key->width = 0;
darray_enumerate(i, groupi, keyi->groups) {
struct xkb_key_type *type;