X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Ffreadptr.c;h=ec483237b76ee03618f05874e132d11026adc8c7;hb=bfca3459b4916724328bc9779cbc4e5934417c09;hp=33471a021f3620f52f4b249fe80c179136d64f5c;hpb=cc6492ad1a98f8e0609788ed65dc7d2b874c991e;p=gnulib.git diff --git a/lib/freadptr.c b/lib/freadptr.c index 33471a021..ec483237b 100644 --- a/lib/freadptr.c +++ b/lib/freadptr.c @@ -27,7 +27,7 @@ freadptr (FILE *fp, size_t *sizep) size_t size; /* Keep this code in sync with freadahead! */ -#if defined _IO_ferror_unlocked /* GNU libc, BeOS */ +#if defined _IO_ferror_unlocked || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Linux libc5 */ if (fp->_IO_write_ptr > fp->_IO_write_base) return NULL; size = fp->_IO_read_end - fp->_IO_read_ptr; @@ -50,7 +50,7 @@ freadptr (FILE *fp, size_t *sizep) fp->_ungetc_count = 0 implies fp->_rcount >= 0. */ if (fp->_rcount <= 0) return NULL; - if (fp->_ungetc_count == 0) + if (!(fp->_ungetc_count == 0)) abort (); *sizep = fp->_rcount; return fp->_ptr;