diff options
author | Bert Münnich <ber.t@posteo.de> | 2018-12-29 18:48:23 +0100 |
---|---|---|
committer | Bert Münnich <ber.t@posteo.de> | 2018-12-29 18:51:14 +0100 |
commit | 674f69f2c9525eef60fbdf0bf5fd147a0018e8eb (patch) | |
tree | fd910c32bdb2e35e0fb75a619480dda6ba99a86c | |
parent | 0bf32654307d285eaf7b538db40548202a6b5596 (diff) |
Fix file list indexes when deleting last image
Fixes issue #331
-rw-r--r-- | main.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -155,11 +155,11 @@ void remove_file(int n, bool manual) memmove(files + n, files + n + 1, (filecnt - n - 1) * sizeof(*files)); } filecnt--; - if (n < fileidx) + if (fileidx > n || fileidx == filecnt) fileidx--; - if (n < alternate) + if (alternate > n || alternate == filecnt) alternate--; - if (n < markidx) + if (markidx > n || markidx == filecnt) markidx--; } |