From 6580e2d4f760fc3b69a03aa3179ce80b2b3d9d55 Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Sat, 24 Oct 2015 14:35:36 +0200 Subject: [PATCH] Warn the user when the area geometry is invalid --- lemonbar.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lemonbar.c b/lemonbar.c index ef3b3cf..73d3ff1 100644 --- a/lemonbar.c +++ b/lemonbar.c @@ -29,7 +29,7 @@ typedef struct font_t { } font_t; typedef struct monitor_t { - int x:16, y:16, width:16; + int x, y, width; xcb_window_t window; xcb_pixmap_t pixmap; struct monitor_t *prev, *next; @@ -369,8 +369,10 @@ area_add (char *str, const char *optend, char **end, monitor_t *mon, const int x a = &area_stack.area[i]; // Basic safety checks - if (!a->cmd || a->align != align || a->window != mon->window) + if (!a->cmd || a->align != align || a->window != mon->window) { + fprintf(stderr, "Invalid geometry for the clickable area\n"); return false; + } const int size = x - a->begin;