Explorar el Código

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

master
Bert Münnich hace 11 años
padre
commit
cc479ca5ac
Se han modificado 2 ficheros con 3 adiciones y 3 borrados
  1. +1
    -1
      Makefile
  2. +2
    -2
      main.c

+ 1
- 1
Makefile Ver fichero

@@ -1,4 +1,4 @@
VERSION = git-20131114 VERSION = git-20131116


PREFIX = /usr/local PREFIX = /usr/local
MANPREFIX = $(PREFIX)/share/man MANPREFIX = $(PREFIX)/share/man


+ 2
- 2
main.c Ver fichero

@@ -296,7 +296,7 @@ void load_image(int new)
remove_file(new, false); remove_file(new, false);
if (new >= filecnt) if (new >= filecnt)
new = filecnt - 1; new = filecnt - 1;
else if (new < fileidx) else if (new > 0 && new < fileidx)
new--; new--;
} }
files[new].loaded = true; files[new].loaded = true;
@@ -532,7 +532,7 @@ void run(void)
tns.cnt++; tns.cnt++;
} else { } else {
remove_file(tns.cnt, false); remove_file(tns.cnt, false);
if (tns.sel >= tns.cnt) if (tns.sel > 0 && tns.sel >= tns.cnt)
tns.sel--; tns.sel--;
} }
if (tns.cnt == filecnt) if (tns.cnt == filecnt)


||||||
x
 
000:0
Cargando…
Cancelar
Guardar