This is the mail archive of the
libc-hacker@sourceware.cygnus.com
mailing list for the glibc project.
Re: bug in fstream get(Ch *p, streamsize n, Ch term )
- To: dj@head-cfa.harvard.edu
- Subject: Re: bug in fstream get(Ch *p, streamsize n, Ch term )
- From: hjl@innovix.com (H.J. Lu)
- Date: Tue, 25 Aug 1998 14:20:03 -0700 (PDT)
- Cc: drepper@cygnus.com (Ulrich Drepper), libc-hacker@cygnus.com (GNU C Library)
Hi, Ulrich,
This is for
http://www.cygnus.com/ml/egcs-bugs/1998-Aug/0504.html
I think we should fix egcs, glibc 2.0 and glibc 2.1.
Thanks.
--
H.J. Lu (hjl@gnu.org)
----
--- libio/iogetline.c.orig Tue Aug 25 14:15:23 1998
+++ libio/iogetline.c Tue Aug 25 14:16:14 1998
@@ -58,7 +58,7 @@ _IO_getline_info (fp, buf, n, delim, ext
{
char *ptr = buf;
if (eof) *eof = 0;
- do
+ while (n != 0)
{
_IO_ssize_t len = fp->_IO_read_end - fp->_IO_read_ptr;
if (len <= 0)
@@ -105,7 +105,7 @@ _IO_getline_info (fp, buf, n, delim, ext
ptr += len;
n -= len;
}
- } while (n != 0);
+ }
return ptr - buf;
}