From 5cab2fb52520e6a24012351b936ebb9162494666 Mon Sep 17 00:00:00 2001 From: NRK Date: Tue, 5 Jul 2022 11:24:53 +0200 Subject: [PATCH] reject empty xresources (#340) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit currently, in case of an empty xresources we would fail to init: nsxiv: Error allocating color '' instead, just reject empty value and use the fallback. Closes: https://codeberg.org/nsxiv/nsxiv/issues/339 Reviewed-on: https://codeberg.org/nsxiv/nsxiv/pulls/340 Reviewed-by: Berke Kocaoğlu Co-authored-by: NRK Co-committed-by: NRK --- window.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/window.c b/window.c index 1b3b6e0..19875e3 100644 --- a/window.c +++ b/window.c @@ -95,7 +95,7 @@ static const char* win_res(XrmDatabase db, const char *name, const char *def) if (db != NULL && XrmGetResource(db, name, name, &type, &ret) && - STREQ(type, "String")) + STREQ(type, "String") && *ret.addr != '\0') { return ret.addr; } else {