From 335ac3f56f554d4e8b2d8c7e9d18a795bc7a2bff Mon Sep 17 00:00:00 2001 From: Sascha Kruse Date: Fri, 13 Jul 2012 10:08:14 +0200 Subject: [PATCH] exit when display can't be opened --- draw.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/draw.c b/draw.c index 51a828e..d55db09 100644 --- a/draw.c +++ b/draw.c @@ -183,8 +183,10 @@ DC *initdc(void) exit(EXIT_FAILURE); } - if (!(dc->dpy = XOpenDisplay(NULL))) + if (!(dc->dpy = XOpenDisplay(NULL))) { eprintf("cannot open display\n"); + exit(EXIT_FAILURE); + } dc->gc = XCreateGC(dc->dpy, DefaultRootWindow(dc->dpy), 0, NULL); XSetLineAttributes(dc->dpy, dc->gc, 1, LineSolid, CapButt, JoinMiter);