summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOkan Demirmen <okan@cvs.openbsd.org>2009-12-07 19:48:09 +0000
committerOkan Demirmen <okan@cvs.openbsd.org>2009-12-07 19:48:09 +0000
commit3da94cdc25bebcd1cd1c8a206a7efe3185d7ce19 (patch)
tree74da4d7575a2610e02715de715c4852add96b22a
parent9bdae93036cb14d17a53c570c51d47e9fbed4017 (diff)
fix off-by-one where a mere click would select the first item inside a menu
from Thomas Pfaff ok oga@
-rw-r--r--app/cwm/menu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/cwm/menu.c b/app/cwm/menu.c
index 83be09bbf..2d02a645f 100644
--- a/app/cwm/menu.c
+++ b/app/cwm/menu.c
@@ -398,7 +398,7 @@ menu_calc_entry(struct screen_ctx *sc, struct menu_ctx *mc, int x, int y)
entry = y / font_height();
/* in bounds? */
- if (x < 0 || x > mc->width || y < 0 || y > font_height() * mc->num ||
+ if (x <= 0 || x > mc->width || y <= 0 || y > font_height() * mc->num ||
entry < 0 || entry >= mc->num)
entry = -1;