x11/keymap,test/interactive-evdev: fix a couple of clang-analyzer warnings From my analysis these values cannot be null, but the analyzer cannot see this. So assert it. Signed-off-by: Ran Benita <ran234@gmail.com>
diff --git a/src/x11/keymap.c b/src/x11/keymap.c
index 0e7a890..408d0eb 100644
--- a/src/x11/keymap.c
+++ b/src/x11/keymap.c
@@ -448,6 +448,7 @@ get_sym_maps(struct xkb_keymap *keymap, xcb_connection_t *conn,
const xkb_layout_index_t group = j / wire_sym_map->width;
const xkb_level_index_t level = j % wire_sym_map->width;
+ assert(key->groups[group].type != NULL);
if (level < key->groups[group].type->num_levels &&
wire_keysym != XKB_KEY_NoSymbol) {
key->groups[group].levels[level].num_syms = 1;
diff --git a/test/interactive-evdev.c b/test/interactive-evdev.c
index 4f12e67..b0b9e62 100644
--- a/test/interactive-evdev.c
+++ b/test/interactive-evdev.c
@@ -203,6 +203,7 @@ get_keyboards(struct xkb_keymap *keymap,
continue;
}
+ assert(kbd != NULL);
kbd->next = kbds;
kbds = kbd;
}