1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-30 22:43:12 +03:00

Fix parsing of decimal point after +-.

This commit is contained in:
Ulrich Drepper
2005-04-24 19:38:19 +00:00
parent 6c63200907
commit 918b198d6e

View File

@ -1602,6 +1602,8 @@ _IO_vfscanf (s, format, argptr, errp)
if (c == EOF) if (c == EOF)
input_error (); input_error ();
got_dot = got_e = 0;
/* Check for a sign. */ /* Check for a sign. */
if (c == L_('-') || c == L_('+')) if (c == L_('-') || c == L_('+'))
{ {
@ -1652,6 +1654,17 @@ _IO_vfscanf (s, format, argptr, errp)
conv_error (); conv_error ();
} }
else
{
/* Add all the characters. */
for (cmpp = decimal; *cmpp != '\0'; ++cmpp)
ADDW ((unsigned char) *cmpp);
if (width > 0)
width = avail;
got_dot = 1;
c = inchar ();
}
if (width > 0) if (width > 0)
width = avail; width = avail;
#endif #endif
@ -1759,7 +1772,6 @@ _IO_vfscanf (s, format, argptr, errp)
} }
} }
got_dot = got_e = 0;
do do
{ {
if (ISDIGIT (c)) if (ISDIGIT (c))