Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'libgloss')
-rw-r--r--libgloss/ChangeLog4
-rw-r--r--libgloss/read.c2
2 files changed, 5 insertions, 1 deletions
diff --git a/libgloss/ChangeLog b/libgloss/ChangeLog
index 844ed477e..407dbb937 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 eb86ea349..419a8ed64 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;
}
}