Fixed segfault when run with -c

This commit is contained in:
Bert Münnich 2014-10-29 14:20:54 +01:00
parent 33b8148614
commit 25077ac764
2 changed files with 2 additions and 2 deletions

View file

@ -1,4 +1,4 @@
VERSION = git-20141025
VERSION = git-20141029
PREFIX = /usr/local
MANPREFIX = $(PREFIX)/share/man

View file

@ -161,7 +161,7 @@ void tns_init(tns_t *tns, const fileinfo_t *files, const int *cnt, int *sel,
if (tns == NULL)
return;
if (*cnt > 0) {
if (cnt != NULL && *cnt > 0) {
tns->thumbs = (thumb_t*) s_malloc(*cnt * sizeof(thumb_t));
memset(tns->thumbs, 0, *cnt * sizeof(thumb_t));
} else {