From 17a2c4977e56ac98e6f06968bdacde370cb22a6f Mon Sep 17 00:00:00 2001 From: ceriel Date: Fri, 6 Feb 1987 10:37:09 +0000 Subject: [PATCH] bug fix --- lang/cem/libcc/stdio/flushbuf.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lang/cem/libcc/stdio/flushbuf.c b/lang/cem/libcc/stdio/flushbuf.c index 6dc918155..90bf01ffd 100644 --- a/lang/cem/libcc/stdio/flushbuf.c +++ b/lang/cem/libcc/stdio/flushbuf.c @@ -14,8 +14,8 @@ _flushbuf(c, iop) else { extern unsigned char _sobuf[]; - iop->_buf = iop->_ptr = _sobuf; - iop->_count = BUFSIZ; + iop->_buf = _sobuf; + iop->_count = BUFSIZ-1; } } else { @@ -25,11 +25,11 @@ _flushbuf(c, iop) iop->_flags |= IO_UNBUFF; } else { - iop->_ptr = iop->_buf; iop->_flags |= IO_MYBUF; - iop->_count = BUFSIZ; + iop->_count = BUFSIZ-1; } } + iop->_ptr = iop->_buf; } } @@ -44,7 +44,7 @@ _flushbuf(c, iop) return c; } else { - int count = BUFSIZ - iop->_count; + int count = iop->_ptr - iop->_buf; iop->_count = BUFSIZ - 1; iop->_ptr = iop->_buf + 1; -- 2.34.1