else {
extern unsigned char _sobuf[];
- iop->_buf = iop->_ptr = _sobuf;
- iop->_count = BUFSIZ;
+ iop->_buf = _sobuf;
+ iop->_count = BUFSIZ-1;
}
}
else {
iop->_flags |= IO_UNBUFF;
}
else {
- iop->_ptr = iop->_buf;
iop->_flags |= IO_MYBUF;
- iop->_count = BUFSIZ;
+ iop->_count = BUFSIZ-1;
}
}
+ iop->_ptr = iop->_buf;
}
}
return c;
}
else {
- int count = BUFSIZ - iop->_count;
+ int count = iop->_ptr - iop->_buf;
iop->_count = BUFSIZ - 1;
iop->_ptr = iop->_buf + 1;