summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorBert Münnich <ber.t@posteo.de>2014-09-11 22:22:51 +0200
committerBert Münnich <ber.t@posteo.de>2014-09-11 22:22:51 +0200
commit52e56c892460e7d1f63ca557b705812f08d6d20c (patch)
tree65672a52c500f040d69a84819ae9d4685ee13850 /main.c
parent2fbc21a2050d1e8e8711afce765b7d34104f45de (diff)
downloadnsxiv-52e56c892460e7d1f63ca557b705812f08d6d20c.tar.zst
Fixed segfault caused by image removal in thumbnail mode
Diffstat (limited to 'main.c')
-rw-r--r--main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/main.c b/main.c
index 933c3cd..4e7e34c 100644
--- a/main.c
+++ b/main.c
@@ -187,7 +187,7 @@ void remove_file(int n, bool manual)
filecnt--;
if (n < tns.cnt)
tns.cnt--;
- if (mode == MODE_THUMB && fileidx >= tns.cnt)
+ if (mode == MODE_THUMB && tns.cnt > 0 && fileidx >= tns.cnt)
fileidx = tns.cnt - 1;
if (n < alternate)
alternate--;