Krolyxon
Commit cc479ca

Branches

Refs →

nsxivcc479ca

Fixed segfault when removing first image from file list, fixes issue #112

Author
Bert Münnich
Date
2013-11-16 20:19 +0100
Parent
091aacb
Commit
cc479ca5ac5ec5050d7acf4c01a3a8e487072ae1

+3 −3

2 files changed

  1. M Makefile +1 −1
  2. M main.c +2 −2
M Makefile View
@@ -1,4 +1,4 @@
1−VERSION = git-20131114
1+VERSION = git-20131116
22
33 PREFIX = /usr/local
44 MANPREFIX = $(PREFIX)/share/man
M main.c View
@@ -296,7 +296,7 @@ void load_image(int new)
296296 remove_file(new, false);
297297 if (new >= filecnt)
298298 new = filecnt - 1;
299− else if (new < fileidx)
299+ else if (new > 0 && new < fileidx)
300300 new--;
301301 }
302302 files[new].loaded = true;
@@ -532,7 +532,7 @@ void run(void)
532532 tns.cnt++;
533533 } else {
534534 remove_file(tns.cnt, false);
535− if (tns.sel >= tns.cnt)
535+ if (tns.sel > 0 && tns.sel >= tns.cnt)
536536 tns.sel--;
537537 }
538538 if (tns.cnt == filecnt)