xkb: Fix key type level names

Fixed invalid level names count for key types without level names.

Signed-off-by: Pierre Le Marre <dev@wismill.eu>
Part-of: <https://gitlab.freedesktop.org/xorg/lib/libx11/-/merge_requests/292>
This commit is contained in:
Pierre Le Marre 2025-10-14 22:53:06 +02:00
parent ff409a48f9
commit 369c6a8065

View file

@ -501,7 +501,7 @@ XkbSetNames(Display *dpy,
BufAlloc(char *, tmp, XkbPaddedSize(nLvlTypes)); BufAlloc(char *, tmp, XkbPaddedSize(nLvlTypes));
type = &xkb->map->types[firstLvlType]; type = &xkb->map->types[firstLvlType];
for (i = 0; i < nLvlTypes; i++, type++) { for (i = 0; i < nLvlTypes; i++, type++) {
*tmp++ = type->num_levels; *tmp++ = (type->level_names == NULL) ? 0 : type->num_levels;
} }
type = &xkb->map->types[firstLvlType]; type = &xkb->map->types[firstLvlType];
for (i = 0; i < nLvlTypes; i++, type++) { for (i = 0; i < nLvlTypes; i++, type++) {