From 0a03e38bc37cdbd54de75691fb9ee9f236ef46c7 Mon Sep 17 00:00:00 2001 From: Johannes Löthberg Date: Mon, 16 Feb 2015 21:50:35 +0100 Subject: Print error and exit when can't open display --- src/yawa.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/yawa.c b/src/yawa.c index ac52c00..ff68732 100644 --- a/src/yawa.c +++ b/src/yawa.c @@ -305,6 +305,10 @@ main(signed argc, char **argv) Pixmap pixmap; Imlib_Color_Modifier modifier = NULL; _display = XOpenDisplay(NULL); + if (!_display) { + fprintf(stderr, "X display could not be opened\n"); + exit(1); + } for (screen = 0; screen < ScreenCount(_display); screen++) { display = XOpenDisplay(NULL); -- cgit v1.2.3-70-g09d2