aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-07-14 14:25:46 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-07-14 14:25:46 +0530
commit0bc5d82d2f479a8fb87831e536e4640b586bf103 (patch)
tree518941f646c5cf09fc40623a7952cb9c2459cdea
parentc051fc3f7e6fb7b4b397fd060d2de033a09b94d4 (diff)
downloadnnn-0bc5d82d2f479a8fb87831e536e4640b586bf103.tar.gz
Fix crash on a broken USB
-rw-r--r--src/nnn.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nnn.c b/src/nnn.c
index 03c60db..1096451 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -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();