diff --git a/lemonbar.c b/lemonbar.c index 3ddf92e..ea494cc 100644 --- a/lemonbar.c +++ b/lemonbar.c @@ -404,10 +404,9 @@ area_t * area_get (xcb_window_t win, const int btn, const int x) { // Looping backwards ensures that we get the innermost area first - for (int i = area_stack.at; i >= 0; i--) { + for (int i = area_stack.at - 1; i >= 0; i--) { area_t *a = &area_stack.area[i]; - if (a->window == win && a->button == btn - && x >= a->begin && x < a->end) + if (a->window == win && a->button == btn && x >= a->begin && x < a->end) return a; } return NULL; @@ -698,7 +697,7 @@ parse (char *text) ucs = 0xfffd; p += 5; } - // Siz byte utf8 sequence + // Six byte utf8 sequence else if ((utf[0] & 0xfe) == 0xfc) { ucs = 0xfffd; p += 6;