diff options
author | Ulrich Drepper <drepper@redhat.com> | 2005-04-24 19:38:19 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2005-04-24 19:38:19 +0000 |
commit | 918b198d6ea3db4ccaa76b96d029490d0e99e5a0 (patch) | |
tree | 41106077c2090489400346cb3d6cdd72d45495f5 | |
parent | 6c6320090733ae6e5edb2e9db7508b454984f11a (diff) | |
download | glibc-918b198d6ea3db4ccaa76b96d029490d0e99e5a0.tar.gz glibc-918b198d6ea3db4ccaa76b96d029490d0e99e5a0.tar.xz glibc-918b198d6ea3db4ccaa76b96d029490d0e99e5a0.zip |
Fix parsing of decimal point after +-.
-rw-r--r-- | stdio-common/vfscanf.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/stdio-common/vfscanf.c b/stdio-common/vfscanf.c index c641d2d371..4434fa6d7b 100644 --- a/stdio-common/vfscanf.c +++ b/stdio-common/vfscanf.c @@ -1602,6 +1602,8 @@ _IO_vfscanf (s, format, argptr, errp) if (c == EOF) input_error (); + got_dot = got_e = 0; + /* Check for a sign. */ if (c == L_('-') || c == L_('+')) { @@ -1652,6 +1654,17 @@ _IO_vfscanf (s, format, argptr, errp) 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) width = avail; #endif @@ -1759,7 +1772,6 @@ _IO_vfscanf (s, format, argptr, errp) } } - got_dot = got_e = 0; do { if (ISDIGIT (c)) |