summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2014-07-05 06:40:54 +0000
committerguenther <guenther@openbsd.org>2014-07-05 06:40:54 +0000
commit4e81b0e5d18944a3fcad20043f40350baf509a7a (patch)
tree0da72d39d9a395c102430e2b01f5c787dafc20e6
parentStop using silly macro when checking for '.' and '..' directory entries (diff)
downloadwireguard-openbsd-4e81b0e5d18944a3fcad20043f40350baf509a7a.tar.xz
wireguard-openbsd-4e81b0e5d18944a3fcad20043f40350baf509a7a.zip
Oops, fix both locations using D_NAMLEN()
-rw-r--r--usr.bin/rdistd/server.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/usr.bin/rdistd/server.c b/usr.bin/rdistd/server.c
index aab44a3058a..9102fb7b78a 100644
--- a/usr.bin/rdistd/server.c
+++ b/usr.bin/rdistd/server.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: server.c,v 1.26 2014/07/05 06:39:13 guenther Exp $ */
+/* $OpenBSD: server.c,v 1.27 2014/07/05 06:40:54 guenther Exp $ */
/*
* Copyright (c) 1983 Regents of the University of California.
@@ -428,9 +428,8 @@ doclean(char *cp)
optarget = ptarget;
len = ptarget - target;
while ((dp = readdir(d)) != NULL) {
- if ((D_NAMLEN(dp) == 1 && dp->d_name[0] == '.') ||
- (D_NAMLEN(dp) == 2 && dp->d_name[0] == '.' &&
- dp->d_name[1] == '.'))
+ if (dp->d_name[0] == '.' && (dp->d_name[1] == '\0' ||
+ dp->d_name[1] == '.' && dp->d_name[2] == '\0'))
continue;
if (len + 1 + (int)strlen(dp->d_name) >= MAXPATHLEN - 1) {