From 558639086a3671472d4f4d50bd802e08af5e7d62 Mon Sep 17 00:00:00 2001 From: Linus Dierheimer Date: Sat, 27 Feb 2021 14:46:31 +0100 Subject: [PATCH] error handling in resolution.c --- src/resolution.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/resolution.c b/src/resolution.c index f9731fe25..0983cffb8 100644 --- a/src/resolution.c +++ b/src/resolution.c @@ -41,15 +41,24 @@ void ffPrintResolution(FFstate* state) void* x11 = dlopen("libX11.so", RTLD_LAZY); if(x11 == NULL) + { + ffPrintError(state, "Resolution", "dlopen(\"libX11.so\", RTLD_LAZY) == NULL"); return; + } Display*(*ffXOpenDisplay)(const char*) = dlsym(x11, "XOpenDisplay"); if(ffXOpenDisplay == NULL) + { + ffPrintError(state, "Resolution", "dlsym(x11, \"XOpenDisplay\") == NULL"); return; + } Display* display = ffXOpenDisplay(NULL); if(display == NULL) + { + ffPrintError(state, "Resolution", "ffXOpenDisplay(NULL) == NULL"); return; + } Screen* screen = DefaultScreenOfDisplay(display);