Fixed remove_file()

This commit is contained in:
Bert 2011-09-03 19:08:49 +02:00
parent a7a849761f
commit c2320a2f49
1 changed files with 5 additions and 5 deletions

10
main.c
View File

@ -116,12 +116,12 @@ void remove_file(int n, unsigned char silent) {
exit(!silent); exit(!silent);
} }
if (n + 1 < filecnt) { if (files[n].path != files[n].name)
if (files[n].path != files[n].name) free((void*) files[n].path);
free((void*) files[n].path); free((void*) files[n].name);
free((void*) files[n].name);
if (n + 1 < filecnt)
memmove(files + n, files + n + 1, (filecnt - n - 1) * sizeof(fileinfo_t)); memmove(files + n, files + n + 1, (filecnt - n - 1) * sizeof(fileinfo_t));
}
if (n + 1 < tns.cnt) { if (n + 1 < tns.cnt) {
memmove(tns.thumbs + n, tns.thumbs + n + 1, (tns.cnt - n - 1) * memmove(tns.thumbs + n, tns.thumbs + n + 1, (tns.cnt - n - 1) *
sizeof(thumb_t)); sizeof(thumb_t));