summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/usr.bin/lndir/lndir.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/usr.bin/lndir/lndir.c b/src/usr.bin/lndir/lndir.c
index a6f3044..bdc5e78 100644
--- a/src/usr.bin/lndir/lndir.c
+++ b/src/usr.bin/lndir/lndir.c
@@ -208,7 +208,7 @@ dodir(char *fn, struct stat *fs, struct stat *ts, int rel)
 	*p++ = '/';
 	n_dirs = fs->st_nlink;
 	while ((dp = readdir(df))) {
-		if (dp->d_namlen == 0 || dp->d_name[dp->d_namlen - 1] == '~' ||
+		if (strlen(dp->d_name) == 0 || dp->d_name[strlen(dp->d_name) - 1] == '~' ||
 		    strncmp(dp->d_name, ".#", 2) == 0)
 			continue;
 		for (cur = exceptions; cur != NULL; cur = cur->next) {