From 214ad6392583f573035377ee0511db7008ece998 Mon Sep 17 00:00:00 2001 From: Adam Niederer Date: Thu, 10 Dec 2015 17:59:58 -0500 Subject: [PATCH 1/2] Fix Typo Siz -> Six in comment --- lemonbar.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lemonbar.c b/lemonbar.c index 4f2ce26..4e33ce4 100644 --- a/lemonbar.c +++ b/lemonbar.c @@ -598,7 +598,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; From 7c8eb7495bd3594d461125e2c99818eb155ff6ef Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Tue, 15 Dec 2015 19:05:39 +0100 Subject: [PATCH 2/2] Fix an off-by-one error in 'area_get'. Fixes #160. --- lemonbar.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lemonbar.c b/lemonbar.c index 4e33ce4..cfd4d9b 100644 --- a/lemonbar.c +++ b/lemonbar.c @@ -326,10 +326,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;