fix problem reading klog when last putchar write last char in buffer
authorJim Bloom <bloom@ucbvax.Berkeley.EDU>
Thu, 27 Feb 1986 08:04:59 +0000 (00:04 -0800)
committerJim Bloom <bloom@ucbvax.Berkeley.EDU>
Thu, 27 Feb 1986 08:04:59 +0000 (00:04 -0800)
SCCS-vsn: sys/kern/subr_prf.c 6.13

usr/src/sys/kern/subr_prf.c

index 338364b..ad0410c 100644 (file)
@@ -3,7 +3,7 @@
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
- *     @(#)subr_prf.c  6.12 (Berkeley) %G%
+ *     @(#)subr_prf.c  6.13 (Berkeley) %G%
  */
 
 #include "param.h"
  */
 
 #include "param.h"
@@ -324,9 +324,9 @@ putchar(c, flags, tp)
                        for (i=0; i < MSG_BSIZE; i++)
                                msgbuf.msg_bufc[i] = 0;
                }
                        for (i=0; i < MSG_BSIZE; i++)
                                msgbuf.msg_bufc[i] = 0;
                }
+               msgbuf.msg_bufc[msgbuf.msg_bufx++] = c;
                if (msgbuf.msg_bufx < 0 || msgbuf.msg_bufx >= MSG_BSIZE)
                        msgbuf.msg_bufx = 0;
                if (msgbuf.msg_bufx < 0 || msgbuf.msg_bufx >= MSG_BSIZE)
                        msgbuf.msg_bufx = 0;
-               msgbuf.msg_bufc[msgbuf.msg_bufx++] = c;
        }
        if ((flags & TOCONS) && c != '\0')
                cnputc(c);
        }
        if ((flags & TOCONS) && c != '\0')
                cnputc(c);