From b112c02fa26967dc8d5aa26dcbe3701821eee6f1 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 17 Feb 1998 15:51:21 +0000 Subject: Update. 1998-02-17 Andreas Jaeger * math/libm.map: Move all symbols that are new in glibc 2.1 to version GLIBC_2.1. 1998-02-17 Ulrich Drepper * stdio-common/vfscanf.c (inchar): Check c for being EOF before trying to read another character. 1998-02-05 Andreas Jaeger * nis/nss_nis/nis-alias.c (_nss_nis_getaliasbyname_r): Convert name to lowercase. * nis/nss_nis/nis-network.c (_nss_nis_getnetbyname_r): Convert name to lowercase, add test for big enough buffer. 1998-02-03 Andreas Jaeger * sysdeps/unix/sysv/linux/alpha/rt_sigaction.S (rt_sigreturn): Make compatible with older kernels. Patch by Richard Henderson. --- stdio-common/vfscanf.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'stdio-common/vfscanf.c') diff --git a/stdio-common/vfscanf.c b/stdio-common/vfscanf.c index 0399e39ef5..bad37f2ad1 100644 --- a/stdio-common/vfscanf.c +++ b/stdio-common/vfscanf.c @@ -57,8 +57,9 @@ # define va_list _IO_va_list # define ungetc(c, s) ((void) ((int) c != EOF && --read_in), \ _IO_ungetc (c, s)) -# define inchar() ((c = _IO_getc_unlocked (s)), \ - (void) (c != EOF && ++read_in), c) +# define inchar() (c == EOF ? EOF \ + : ((c = _IO_getc_unlocked (s)), \ + (void) (c != EOF && ++read_in), c)) # define encode_error() do { \ if (errp != NULL) *errp |= 4; \ _IO_funlockfile (s); \ @@ -102,7 +103,8 @@ # define UNLOCK_STREAM __libc_cleanup_region_end (1) #else # define ungetc(c, s) ((void) (c != EOF && --read_in), ungetc (c, s)) -# define inchar() ((c = getc (s)), (void) (c != EOF && ++read_in), c) +# define inchar() (c == EOF ? EOF \ + : (c = getc (s)), (void) (c != EOF && ++read_in), c) # define encode_error() do { \ funlockfile (s); \ __set_errno (EILSEQ); \ -- cgit v1.2.3