2004-09-21 Joerg Wunsch * libc/stdio/vfscanf.c: fix parsing of multiple float values; fix for bug #10068. Index: libc/stdio/vfscanf.c =================================================================== RCS file: /cvsroot/avr-libc/avr-libc/libc/stdio/vfscanf.c,v retrieving revision 1.7 diff -u -u -r1.7 vfscanf.c --- libc/stdio/vfscanf.c 19 Sep 2004 21:04:13 -0000 1.7 +++ libc/stdio/vfscanf.c 20 Sep 2004 22:15:16 -0000 @@ -479,6 +479,10 @@ } if ((char)i == 'e' || (char)i == 'E') { + /* + * Prevent another 'E' + * from being recognized. + */ fltchars[10] = 0; *bp++ = i; if ((i = getc(stream)) == EOF) @@ -487,6 +491,13 @@ (char)i != '+') continue; } else if ((char)i == '.') + /* + * Prevent another dot from + * being recognized. If we + * already saw an 'E' + * above, we could not get + * here at all. + */ fltchars[12] = 0; *bp++ = i; if ((i = getc(stream)) == EOF) @@ -497,6 +508,12 @@ if (flags & FLMINUS) a.d = -a.d; *(va_arg(ap, double *)) = a.d; + /* + * Restore the 'E' and '.' chars that + * might have been clobbered above. + */ + fltchars[10] = 'E'; + fltchars[12] = '.'; break; case '[':