diff options
author | Jeff Johnston <jjohnstn@redhat.com> | 2002-07-18 20:04:59 +0000 |
---|---|---|
committer | Jeff Johnston <jjohnstn@redhat.com> | 2002-07-18 20:04:59 +0000 |
commit | 3b0f85c0f1d08bca52f780362516e7d50abadf58 (patch) | |
tree | 085e8bb5cb58185b58d3679f467a2f916567537e /libgloss | |
parent | dee51391315e2bb819409a6b3eb23ee6ef6d3c59 (diff) | |
download | newlib-3b0f85c0f1d08bca52f780362516e7d50abadf58.zip newlib-3b0f85c0f1d08bca52f780362516e7d50abadf58.tar.gz newlib-3b0f85c0f1d08bca52f780362516e7d50abadf58.tar.bz2 |
2002-07-18 Chris Demetriou <cgd@broadcom.com>
* read.c (read): Don't assign past end of buffer, fix return value.
Diffstat (limited to 'libgloss')
-rw-r--r-- | libgloss/ChangeLog | 4 | ||||
-rw-r--r-- | libgloss/read.c | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/libgloss/ChangeLog b/libgloss/ChangeLog index 844ed47..407dbb9 100644 --- a/libgloss/ChangeLog +++ b/libgloss/ChangeLog @@ -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> * mips/Makefile.in (GENOBJS2): New variable to name other diff --git a/libgloss/read.c b/libgloss/read.c index eb86ea3..419a8ed 100644 --- a/libgloss/read.c +++ b/libgloss/read.c @@ -31,7 +31,7 @@ _DEFUN (read, (fd, buf, nbytes), for (i = 0; i < nbytes; i++) { *(buf + i) = inbyte(); if ((*(buf + i) == '\n') || (*(buf + i) == '\r')) { - (*(buf + i + 1)) = 0; + i++; break; } } |