aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorDavid Greenman <dg@FreeBSD.org>1995-08-06 22:00:17 +0000
committerDavid Greenman <dg@FreeBSD.org>1995-08-06 22:00:17 +0000
commit02d5c7b197ef3368fe3a04cbb43047be931bec6a (patch)
treee63f9c98dc0674dcb513a67f18e967202cc034d0 /sys
parent352abcd4a779e559df5eaa4c5e595c462530c8a8 (diff)
Notes
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/subr_prf.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/kern/subr_prf.c b/sys/kern/subr_prf.c
index e8813bceb292..0c0f886c8c7f 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;
}
}