diff options
author | dg <dg@FreeBSD.org> | 1995-08-06 22:00:17 +0000 |
---|---|---|
committer | dg <dg@FreeBSD.org> | 1995-08-06 22:00:17 +0000 |
commit | f0b49bdd9e4c38d2f87ac4bff85ea99d0377c3e1 (patch) | |
tree | e63f9c98dc0674dcb513a67f18e967202cc034d0 /sys/kern/subr_prf.c | |
parent | 8bdb8276ba8ae163b30582387439aaddcb2f213a (diff) | |
download | FreeBSD-src-f0b49bdd9e4c38d2f87ac4bff85ea99d0377c3e1.zip FreeBSD-src-f0b49bdd9e4c38d2f87ac4bff85ea99d0377c3e1.tar.gz |
Restore check for msg_bufx being negative. Changed if() expression to be
in Lite2 style.
Diffstat (limited to 'sys/kern/subr_prf.c')
-rw-r--r-- | sys/kern/subr_prf.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/kern/subr_prf.c b/sys/kern/subr_prf.c index e8813bc..0c0f886 100644 --- a/sys/kern/subr_prf.c +++ b/sys/kern/subr_prf.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)subr_prf.c 8.3 (Berkeley) 1/21/94 - * $Id: subr_prf.c,v 1.13 1995/04/08 21:32:11 joerg Exp $ + * $Id: subr_prf.c,v 1.14 1995/06/14 07:55:07 bde Exp $ */ #include <sys/param.h> @@ -509,11 +509,11 @@ putchar(c, flags, tp) mbp->msg_magic = MSG_MAGIC; } mbp->msg_bufc[mbp->msg_bufx++] = c; - if (mbp->msg_bufx >= MSG_BSIZE) + if (mbp->msg_bufx < 0 || mbp->msg_bufx >= MSG_BSIZE) mbp->msg_bufx = 0; + /* If the buffer is full, keep the most recent data. */ if (mbp->msg_bufr == mbp->msg_bufx) { - mbp->msg_bufr++; - if (mbp->msg_bufr >= MSG_BSIZE) + if (++mbp->msg_bufr >= MSG_BSIZE) mbp->msg_bufr = 0; } } |