To reproduce the problem compile an run the followin little program: #include <stdio.h> int main (int argc, char **argv) { float f1, f2, f3, f4; printf ("scanf = %d\n", scanf ("%2f%2f%2f%2f", &f1, &f2, &f3, &f4)); printf ("f1 = %f\n", f1); printf ("f2 = %f\n", f2); printf ("f3 = %f\n", f3); printf ("f4 = %f\n", f4); return 0; } running the program with an input of "01020304" gives: 01020304 scanf = 4 f1 = 10.000000 f2 = 20.000000 f3 = 30.000000 f4 = 4.000000 It should be: 01020304 scanf = 4 f1 = 1.000000 f2 = 2.000000 f3 = 3.000000 f4 = 4.000000
Just tried it here... [rhw@ps rhw]$ gcc -Wall -o x x.c [rhw@ps rhw]$ ./x 01020304 scanf = 4 f1 = 1.000000 f2 = 2.000000 f3 = 3.000000 f4 = 4.000000 [rhw@ps rhw]$ Looks fine to me. For reference... Kernel 2.2.13 (SMP - Dual P2/350) Kernel modules 2.1.121 Gnu C 2.7.2.3 Binutils 2.9.1.0.4 Linux C Library 0.7.so* Dynamic linker ldd (GNU libc) 2.0.7 Linux C++ Library 2.8.0* Procps 1.2.9 Mount 2.7l Net-tools 1.50 Kbd 0.94 Sh-utils 1.16
assign to jakub
Fixed in glibc 2.1.92