Help static analysis with an assertion

It is hard for clang to see that layouts will
always be smaller than num_layouts, so just assert
that.
This commit is contained in:
Matthias Clasen 2020-05-25 20:38:16 -04:00
parent 0f096d6ad9
commit ec39ddee63

View File

@ -412,6 +412,7 @@ update_direction (GdkWaylandKeymap *keymap)
gint layouts, layout;
layouts = xkb_keymap_num_layouts_for_key (keymap->xkb_keymap, key);
g_assert (layouts <= num_layouts);
for (layout = 0; layout < layouts; layout++)
{
const xkb_keysym_t *syms;