diff options
author | 2006-09-25 06:03:29 +0000 | |
---|---|---|
committer | 2006-09-25 06:03:29 +0000 | |
commit | 63f687827b381354fd151b751054eb0fa8bb4061 (patch) | |
tree | 93474f8d0914db3f31afc7bd6ee273f9c65e7b5e | |
parent | Use S_IS* macros insted of masking with S_IF* flags. The latter may (diff) | |
download | wireguard-openbsd-63f687827b381354fd151b751054eb0fa8bb4061.tar.xz wireguard-openbsd-63f687827b381354fd151b751054eb0fa8bb4061.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
from Paul Stoeber, more to come.
-rw-r--r-- | games/fortune/fortune/fortune.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/games/fortune/fortune/fortune.c b/games/fortune/fortune/fortune.c index 2ef1cacbb2a..faa2df1f9c9 100644 --- a/games/fortune/fortune/fortune.c +++ b/games/fortune/fortune/fortune.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fortune.c,v 1.22 2005/09/24 18:10:02 mickey Exp $ */ +/* $OpenBSD: fortune.c,v 1.23 2006/09/25 06:03:29 otto Exp $ */ /* $NetBSD: fortune.c,v 1.8 1995/03/23 08:28:40 cgd Exp $ */ /*- @@ -43,7 +43,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)fortune.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$OpenBSD: fortune.c,v 1.22 2005/09/24 18:10:02 mickey Exp $"; +static char rcsid[] = "$OpenBSD: fortune.c,v 1.23 2006/09/25 06:03:29 otto Exp $"; #endif #endif /* not lint */ @@ -712,7 +712,7 @@ is_dir(char *file) if (stat(file, &sbuf) < 0) return FALSE; - return (sbuf.st_mode & S_IFDIR); + return S_ISDIR(sbuf.st_mode); } /* |