Fix crash on a broken USB

This commit is contained in:
Arun Prakash Jana 2019-07-14 14:25:46 +05:30
parent c051fc3f7e
commit 0bc5d82d2f
No known key found for this signature in database
GPG Key ID: A75979F35C080412
1 changed files with 3 additions and 3 deletions

View File

@ -2845,8 +2845,8 @@ static int dentfill(char *path, struct entry **dents)
}
dp = readdir(dirp);
// if (!dp) /* We have opened the dir, at least . would be returned */
// goto exit;
if (!dp)
goto exit;
if (cfg.blkorder || dp->d_type == DT_UNKNOWN) {
/*
@ -3007,7 +3007,7 @@ static int dentfill(char *path, struct entry **dents)
++n;
} while ((dp = readdir(dirp)));
//exit:
exit:
/* Should never be null */
if (closedir(dirp) == -1) {
dentfree();