aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNRK <nrk@disroot.org>2022-07-05 11:24:53 +0200
committerBerke Kocaoğlu <berke.kocaoglu@metu.edu.tr>2022-07-05 11:24:53 +0200
commit5cab2fb52520e6a24012351b936ebb9162494666 (patch)
treeedd27bce7b97b9b67ca334f0da1de1bb54eb60eb
parent51d4c8dd4f793114cbc520f2a8465981bd1d4eaa (diff)
downloadnsxiv-5cab2fb52520e6a24012351b936ebb9162494666.tar.zst
reject empty xresources (#340)
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 <berke.kocaoglu@metu.edu.tr> Co-authored-by: NRK <nrk@disroot.org> Co-committed-by: NRK <nrk@disroot.org>
-rw-r--r--window.c2
1 files changed, 1 insertions, 1 deletions
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 {