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>
pull/345/head
NRK 2 years ago committed by Berke Kocaoğlu
parent 51d4c8dd4f
commit 5cab2fb525

@ -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 {

Loading…
Cancel
Save