summaryrefslogtreecommitdiffstats
path: root/usr.bin/rcs/rcsutil.c
diff options
context:
space:
mode:
authorotto <otto@openbsd.org>2006-09-19 05:52:23 +0000
committerotto <otto@openbsd.org>2006-09-19 05:52:23 +0000
commitdc8143a2983ba6a6691e69e5fc1422afdba4cac7 (patch)
tree1a115f22a19dc7832d58932df8c5b3d74e9e51a4 /usr.bin/rcs/rcsutil.c
parentadd a missing space to a DMA load error printf. (diff)
downloadwireguard-openbsd-dc8143a2983ba6a6691e69e5fc1422afdba4cac7.tar.xz
wireguard-openbsd-dc8143a2983ba6a6691e69e5fc1422afdba4cac7.zip
Use S_IS* macros insted of masking with S_IF* flags. The latter may
have multiple bits set, which lead to surprising results. Spotted by Paul Stoeber, more to come. ok millert@ pedro@ jaredy@ djm@
Diffstat (limited to 'usr.bin/rcs/rcsutil.c')
-rw-r--r--usr.bin/rcs/rcsutil.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/rcs/rcsutil.c b/usr.bin/rcs/rcsutil.c
index 6c25e21acd2..43a594f1562 100644
--- a/usr.bin/rcs/rcsutil.c
+++ b/usr.bin/rcs/rcsutil.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rcsutil.c,v 1.18 2006/08/16 07:39:15 ray Exp $ */
+/* $OpenBSD: rcsutil.c,v 1.19 2006/09/19 05:52:23 otto Exp $ */
/*
* Copyright (c) 2005, 2006 Joris Vink <joris@openbsd.org>
* Copyright (c) 2006 Xavier Santolaria <xsa@openbsd.org>
@@ -171,7 +171,7 @@ rcs_choosefile(const char *filename, char *out, size_t len)
strlcat(rcsdir, RCSDIR, sizeof(rcsdir)) >= sizeof(rcsdir))
errx(1, "rcs_choosefile: truncation");
- if (stat(rcsdir, &sb) == 0 && (sb.st_mode & S_IFDIR))
+ if (stat(rcsdir, &sb) == 0 && S_ISDIR(sb.st_mode))
if (strlcpy(rcspath, rcsdir, sizeof(rcspath))
>= sizeof(rcspath) ||
strlcat(rcspath, "/", sizeof(rcspath)) >= sizeof(rcspath))