From 2bcd7d59789e29c0979e4586e27c91231e0d98b0 Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Tue, 19 Sep 2006 05:52:24 +0000 Subject: 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@ --- usr.bin/sdiff/sdiff.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'usr.bin/sdiff') 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 . @@ -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. */ -- cgit v1.2.3