mirror of
https://github.com/jarun/nnn.git
synced 2025-01-10 09:59:56 +00:00
Fix crash on a broken USB
This commit is contained in:
parent
c051fc3f7e
commit
0bc5d82d2f
|
@ -2845,8 +2845,8 @@ static int dentfill(char *path, struct entry **dents)
|
||||||
}
|
}
|
||||||
|
|
||||||
dp = readdir(dirp);
|
dp = readdir(dirp);
|
||||||
// if (!dp) /* We have opened the dir, at least . would be returned */
|
if (!dp)
|
||||||
// goto exit;
|
goto exit;
|
||||||
|
|
||||||
if (cfg.blkorder || dp->d_type == DT_UNKNOWN) {
|
if (cfg.blkorder || dp->d_type == DT_UNKNOWN) {
|
||||||
/*
|
/*
|
||||||
|
@ -3007,7 +3007,7 @@ static int dentfill(char *path, struct entry **dents)
|
||||||
++n;
|
++n;
|
||||||
} while ((dp = readdir(dirp)));
|
} while ((dp = readdir(dirp)));
|
||||||
|
|
||||||
//exit:
|
exit:
|
||||||
/* Should never be null */
|
/* Should never be null */
|
||||||
if (closedir(dirp) == -1) {
|
if (closedir(dirp) == -1) {
|
||||||
dentfree();
|
dentfree();
|
||||||
|
|
Loading…
Reference in a new issue