aboutsummaryrefslogtreecommitdiff
path: root/stdio-common/vfscanf.c
diff options
context:
space:
mode:
Diffstat (limited to 'stdio-common/vfscanf.c')
-rw-r--r--stdio-common/vfscanf.c19
1 files changed, 10 insertions, 9 deletions
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);