fix: crash when cache directory is not present
to reproduce: ( unset HOME XDG_CACHE_HOME; nsxiv -t ~/pictures; ) the code never really worked without a cache_dir going back to original sxiv. so just fatally error out instead of crashing with a null pointer dereference.
This commit is contained in:
parent
36d5b27fff
commit
b6d9e7d24f
2
thumbs.c
2
thumbs.c
|
@ -181,7 +181,7 @@ void tns_init(tns_t *tns, fileinfo_t *tns_files, const int *cnt, int *sel, win_t
|
|||
memcpy(cache_tmpfile, cache_dir, len - 1);
|
||||
cache_tmpfile_base = cache_tmpfile + len - 1;
|
||||
} else {
|
||||
error(0, 0, "Cache directory not found");
|
||||
error(EXIT_FAILURE, 0, "Cache directory not found");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue