From f4efd06825ba5fec62662be611d94335eff4f8f7 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 27 Nov 2001 02:20:12 +0000 Subject: Update. 2001-11-26 Ulrich Drepper * stdio-common/vfscanf.c: If incomplete nan of inf(inity) strings are found call conv_error and not input_error [PR libc/2669]. * math/bits/mathcalls.h: Mark ceil and floor as const. Reported by David Mosberger. 2001-11-21 Jim Meyering * posix/regex.c (iswctype, mbrtowc, wcslen, wcscoll, wcrtomb) [_LIBC]: Define to be __-prefixed. Remove unnecessary duplication in `#ifdef _LIBC' blocks. --- stdio-common/vfscanf.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'stdio-common') diff --git a/stdio-common/vfscanf.c b/stdio-common/vfscanf.c index 0b53d7e0b6..b4b7d4dff1 100644 --- a/stdio-common/vfscanf.c +++ b/stdio-common/vfscanf.c @@ -1596,7 +1596,8 @@ __vfscanf (FILE *s, const char *format, va_list argptr) if (width == 0 || inchar () == EOF) /* EOF is only an input error before we read any chars. */ conv_error (); - if (! ISDIGIT (c) && TOLOWER (c) != L_('i')) + if (! ISDIGIT (c) && TOLOWER (c) != L_('i') + && TOLOWER (c) != L_('n')) { #ifdef COMPILE_WSCANF if (c != decimal) @@ -1654,12 +1655,12 @@ __vfscanf (FILE *s, const char *format, va_list argptr) /* Maybe "nan". */ ADDW (c); if (width == 0 || inchar () == EOF || TOLOWER (c) != L_('a')) - input_error (); + conv_error (); if (width > 0) --width; ADDW (c); if (width == 0 || inchar () == EOF || TOLOWER (c) != L_('n')) - input_error (); + conv_error (); if (width > 0) --width; ADDW (c); @@ -1671,12 +1672,12 @@ __vfscanf (FILE *s, const char *format, va_list argptr) /* Maybe "inf" or "infinity". */ ADDW (c); if (width == 0 || inchar () == EOF || TOLOWER (c) != L_('n')) - input_error (); + conv_error (); if (width > 0) --width; ADDW (c); if (width == 0 || inchar () == EOF || TOLOWER (c) != L_('f')) - input_error (); + conv_error (); if (width > 0) --width; ADDW (c); @@ -1691,25 +1692,25 @@ __vfscanf (FILE *s, const char *format, va_list argptr) ADDW (c); if (width == 0 || inchar () == EOF || TOLOWER (c) != L_('n')) - input_error (); + conv_error (); if (width > 0) --width; ADDW (c); if (width == 0 || inchar () == EOF || TOLOWER (c) != L_('i')) - input_error (); + conv_error (); if (width > 0) --width; ADDW (c); if (width == 0 || inchar () == EOF || TOLOWER (c) != L_('t')) - input_error (); + conv_error (); if (width > 0) --width; ADDW (c); if (width == 0 || inchar () == EOF || TOLOWER (c) != L_('y')) - input_error (); + conv_error (); if (width > 0) --width; ADDW (c); -- cgit v1.2.3