diff options
author | 2014-07-05 06:39:13 +0000 | |
---|---|---|
committer | 2014-07-05 06:39:13 +0000 | |
commit | ecf61e9c4fe2357f8a24666093c18c42f40d4018 (patch) | |
tree | 65fdd96857f1c1c56aa406d497a80ba3a3670603 | |
parent | Assume POSIX: waitpid(), select(), and <sys/select.h> (diff) | |
download | wireguard-openbsd-ecf61e9c4fe2357f8a24666093c18c42f40d4018.tar.xz wireguard-openbsd-ecf61e9c4fe2357f8a24666093c18c42f40d4018.zip |
Stop using silly macro when checking for '.' and '..' directory entries
-rw-r--r-- | usr.bin/rdistd/server.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/usr.bin/rdistd/server.c b/usr.bin/rdistd/server.c index 98f89c98a37..aab44a3058a 100644 --- a/usr.bin/rdistd/server.c +++ b/usr.bin/rdistd/server.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server.c,v 1.25 2013/10/27 18:31:24 guenther Exp $ */ +/* $OpenBSD: server.c,v 1.26 2014/07/05 06:39:13 guenther Exp $ */ /* * Copyright (c) 1983 Regents of the University of California. @@ -345,9 +345,8 @@ removefile(struct stat *statb, int silent) 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) { |