]> sourceware.org Git - glibc.git/commitdiff
Fix parsing of decimal point after +-.
authorUlrich Drepper <drepper@redhat.com>
Sun, 24 Apr 2005 19:38:19 +0000 (19:38 +0000)
committerUlrich Drepper <drepper@redhat.com>
Sun, 24 Apr 2005 19:38:19 +0000 (19:38 +0000)
stdio-common/vfscanf.c

index c641d2d37104c89847de88fb4749db13407d56f7..4434fa6d7b8c3cdaf5d7973d9da99c8f0ba5fc2b 100644 (file)
@@ -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))
This page took 0.043835 seconds and 5 git commands to generate.