From 7c11f890a5296ddd527ca956503bb33ceacd3ca9 Mon Sep 17 00:00:00 2001 From: Aaron Marcher Date: Wed, 2 May 2018 08:26:23 +0200 Subject: keyboard_indicators: Clean up opening display --- components/keyboard_indicators.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'components/keyboard_indicators.c') diff --git a/components/keyboard_indicators.c b/components/keyboard_indicators.c index 76cf17e..ed4bc17 100644 --- a/components/keyboard_indicators.c +++ b/components/keyboard_indicators.c @@ -7,10 +7,10 @@ const char * keyboard_indicators(void) { - Display *dpy = XOpenDisplay(NULL); + Display *dpy; XKeyboardState state; - if (dpy == NULL) { + if (!(dpy = XOpenDisplay(NULL))) { fprintf(stderr, "Cannot open display\n"); return NULL; } -- cgit v1.2.3