2002-07-18 Chris Demetriou <cgd@broadcom.com>

* read.c (read): Don't assign past end of buffer, fix return value.
This commit is contained in:
Jeff Johnston 2002-07-18 20:04:59 +00:00
parent dee5139131
commit 3b0f85c0f1
2 changed files with 5 additions and 1 deletions

View File

@ -1,3 +1,7 @@
2002-07-18 Chris Demetriou <cgd@broadcom.com>
* read.c (read): Don't assign past end of buffer, fix return value.
2002-07-12 Chris Demetriou <cgd@broadcom.com> 2002-07-12 Chris Demetriou <cgd@broadcom.com>
* mips/Makefile.in (GENOBJS2): New variable to name other * mips/Makefile.in (GENOBJS2): New variable to name other

View File

@ -31,7 +31,7 @@ _DEFUN (read, (fd, buf, nbytes),
for (i = 0; i < nbytes; i++) { for (i = 0; i < nbytes; i++) {
*(buf + i) = inbyte(); *(buf + i) = inbyte();
if ((*(buf + i) == '\n') || (*(buf + i) == '\r')) { if ((*(buf + i) == '\n') || (*(buf + i) == '\r')) {
(*(buf + i + 1)) = 0; i++;
break; break;
} }
} }