diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2000-03-13 04:05:16 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2000-03-13 04:05:16 +0000 |
commit | 09bc8f72a9ed3c3886baf6d772b39aafcd78d661 (patch) | |
tree | e4eef71f9cb00ba5147a1eeffa17fdbe74552cb7 /sys/kern/subr_prf.c | |
parent | 922db23a8474ee3bcfb544d5501d9203c1adbf8d (diff) |
Get rid of leading NULs in /kern/msgbuf. If the msgbuf modified in between
reads at just the right time is is possible to get duplicate output but
in practice this is extremely rare. Joint effort with Theo.
Diffstat (limited to 'sys/kern/subr_prf.c')
-rw-r--r-- | sys/kern/subr_prf.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/kern/subr_prf.c b/sys/kern/subr_prf.c index 5ab131ddc8d..5bd4b69546d 100644 --- a/sys/kern/subr_prf.c +++ b/sys/kern/subr_prf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: subr_prf.c,v 1.28 2000/03/02 10:50:29 art Exp $ */ +/* $OpenBSD: subr_prf.c,v 1.29 2000/03/13 04:05:15 millert Exp $ */ /* $NetBSD: subr_prf.c,v 1.45 1997/10/24 18:14:25 chuck Exp $ */ /*- @@ -335,6 +335,7 @@ putchar(c, flags, tp) /* Nothing we can do */ } mbp->msg_bufc[mbp->msg_bufx++] = c; + mbp->msg_bufl = min(mbp->msg_bufl+1, mbp->msg_bufs); if (mbp->msg_bufx < 0 || mbp->msg_bufx >= mbp->msg_bufs) mbp->msg_bufx = 0; /* If the buffer is full, keep the most recent data. */ |