diff options
author | Otto Moerbeek <otto@cvs.openbsd.org> | 2006-09-19 05:52:24 +0000 |
---|---|---|
committer | Otto Moerbeek <otto@cvs.openbsd.org> | 2006-09-19 05:52:24 +0000 |
commit | 2bcd7d59789e29c0979e4586e27c91231e0d98b0 (patch) | |
tree | 5dd2bc9696ae22a3cce9ac3a7b267336caf4f3a2 /usr.bin/sdiff | |
parent | bec9fbb71b6b98020d52074619a34722765ce4ac (diff) |
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/sdiff')
-rw-r--r-- | usr.bin/sdiff/sdiff.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/sdiff/sdiff.c b/usr.bin/sdiff/sdiff.c index a46394be6b4..991c2d65b8c 100644 --- a/usr.bin/sdiff/sdiff.c +++ b/usr.bin/sdiff/sdiff.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sdiff.c,v 1.19 2006/05/25 03:20:32 ray Exp $ */ +/* $OpenBSD: sdiff.c,v 1.20 2006/09/19 05:52:23 otto Exp $ */ /* * Written by Raymond Lai <ray@cyth.net>. @@ -108,7 +108,7 @@ mktmpcpy(const char *source_file) err(2, "error getting file status from %s", source_file); /* Regular file. */ - if (sb.st_mode & S_IFREG) + if (S_ISREG(sb.st_mode)) return (NULL); } else { /* If ``-'' does not exist the user meant stdin. */ |