From 2c2741a9cc571b0555390991583075b0e392fcdc Mon Sep 17 00:00:00 2001 From: Samuel Dudik Date: Sat, 8 Aug 2020 15:55:18 +0200 Subject: [PATCH] Minor tweaks --- herbe.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/herbe.c b/herbe.c index 438d1bc..e219301 100644 --- a/herbe.c +++ b/herbe.c @@ -4,6 +4,7 @@ #include #include #include +#include #include "config.h" @@ -60,9 +61,9 @@ int main(int argc, char *argv[]) signal(SIGALRM, expire); alarm(duration); - display = XOpenDisplay(NULL); + display = XOpenDisplay(0); - if (display == NULL) + if (display == 0) { fprintf(stderr, "Cannot open display\n"); exit(EXIT_FAILURE); @@ -123,10 +124,9 @@ int main(int argc, char *argv[]) XMapWindow(display, window); - XEvent event; - while (1) { + XEvent event; XNextEvent(display, &event); if (event.type == Expose) @@ -142,7 +142,7 @@ int main(int argc, char *argv[]) XftDrawDestroy(draw); XftColorFree(display, visual, colormap, &color); XftFontClose(display, font); - XCloseDisplay(display); + return EXIT_SUCCESS; -} +} \ No newline at end of file