about summary refs log tree commit diff
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2014-07-31 16:02:20 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2014-07-31 16:02:20 +0200
commit92f91930172eec04f302898d2957e32f1d773348 (patch)
tree15eccb35842f5bc3519efcf714398ce1629c8288
parent032c69d9e1dfa7929fa6daabeaa53cf12da6ceb8 (diff)
downloadoutils-92f91930172eec04f302898d2957e32f1d773348.tar.gz
outils-92f91930172eec04f302898d2957e32f1d773348.tar.xz
outils-92f91930172eec04f302898d2957e32f1d773348.zip
lndir.c: dont use d_namlen
-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) {