aboutsummaryrefslogtreecommitdiffstats
path: root/thumbs.c
diff options
context:
space:
mode:
authorNRK <nrk@disroot.org>2024-06-13 00:03:41 +0200
committerNRK <nrk@disroot.org>2024-06-18 17:11:36 +0200
commitb6d9e7d24f8e974749c41d8eaa7e21273548ff7f (patch)
treef9030794451a1da79ec61fbb562d95d1d464ff45 /thumbs.c
parent36d5b27fff21f4b8475a594dabbd7b59630c9bee (diff)
downloadnsxiv-b6d9e7d24f8e974749c41d8eaa7e21273548ff7f.tar.zst
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.
Diffstat (limited to 'thumbs.c')
-rw-r--r--thumbs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/thumbs.c b/thumbs.c
index c7b9dc6..d91405e 100644
--- a/thumbs.c
+++ b/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");
}
}