diff options
| author | explorer <explorer@NetBSD.org> | 1996-08-13 07:54:00 +0000 |
|---|---|---|
| committer | explorer <explorer@NetBSD.org> | 1996-08-13 07:54:00 +0000 |
| commit | 5b3a9aad8d198c879dc3f573a8d0be82bf21ffcb (patch) | |
| tree | 0fa2f89f1b730c724492cde1a0c3ed01cd05a7be /lib/libc/stdio | |
| parent | 7785d71935c244b3dcaf1ffef063e6c34a6dcd16 (diff) | |
Cute little bug with operator precedence in our stdio code. It appears
that flushing wasn't done right when input buffers were refilled, due
to a check like
if (foo == _A | _B) which, since _A and _B are both != 0, always
evaluates to true.
Found by proven@cygnus.com
Diffstat (limited to 'lib/libc/stdio')
| -rw-r--r-- | lib/libc/stdio/refill.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libc/stdio/refill.c b/lib/libc/stdio/refill.c index 08171d78cc4..ebf131f8f90 100644 --- a/lib/libc/stdio/refill.c +++ b/lib/libc/stdio/refill.c @@ -1,4 +1,4 @@ -/* $NetBSD: refill.c,v 1.5 1996/03/29 23:29:18 jtc Exp $ */ +/* $NetBSD: refill.c,v 1.6 1996/08/13 07:54:00 explorer Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -40,7 +40,7 @@ #if 0 static char sccsid[] = "@(#)refill.c 8.1 (Berkeley) 6/4/93"; #endif -static char rcsid[] = "$NetBSD: refill.c,v 1.5 1996/03/29 23:29:18 jtc Exp $"; +static char rcsid[] = "$NetBSD: refill.c,v 1.6 1996/08/13 07:54:00 explorer Exp $"; #endif /* LIBC_SCCS and not lint */ #include <errno.h> @@ -53,7 +53,7 @@ lflush(fp) FILE *fp; { - if ((fp->_flags & (__SLBF|__SWR)) == __SLBF|__SWR) + if ((fp->_flags & (__SLBF|__SWR)) == (__SLBF|__SWR)) return (__sflush(fp)); return (0); } |
