diff --git a/ewmh.c b/ewmh.c index 17bb886b..54607342 100644 --- a/ewmh.c +++ b/ewmh.c @@ -175,7 +175,8 @@ ewmh_update_net_current_desktop(int phys_screen) uint32_t count = 0; tag_t **curtags = tags_get_current(phys_screen); - for(count = 0; tags->tab[count] != curtags[0]; count++); + while(count < (uint32_t) tags->len && tags->tab[count] != curtags[0]) + count++; xcb_change_property(globalconf.connection, XCB_PROP_MODE_REPLACE, xutil_screen_get(globalconf.connection, phys_screen)->root,