nsxiv5cab2fb
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
+1 −1
1 file changed
- M window.c +1 −1
| @@ -95,7 +95,7 @@ static const char* win_res(XrmDatabase db, const char *name, const char *def) | |||
| 95 | 95 | ||
| 96 | 96 | if (db != NULL && | |
| 97 | 97 | XrmGetResource(db, name, name, &type, &ret) && | |
| 98 | − | STREQ(type, "String")) | |
| 98 | + | STREQ(type, "String") && *ret.addr != '\0') | |
| 99 | 99 | { | |
| 100 | 100 | return ret.addr; | |
| 101 | 101 | } else { | |