Update to 2.1.x development version
[glibc/history.git] / stdio-common / scanf2.c
blob452104d5aaaba8f2b21652e283c2ddf9f89927b9
1 #include <stdio.h>
2 #include <stdlib.h>
4 int
5 main(int argc, char *argv[])
7 int point, x, y;
9 point = x = y = -1;
10 sscanf("0x10 10", "%x %x", &x, &y);
11 printf("%d %d\n", x, y);
12 if (x != 0x10 || y != 0x10)
13 abort ();
14 point = x = y = -1;
15 sscanf("P012349876", "P%1d%4d%4d", &point, &x, &y);
16 printf("%d %d %d\n", point, x, y);
17 if (point != 0 || x != 1234 || y != 9876)
18 abort ();
19 point = x = y = -1;
20 sscanf("P112349876", "P%1d%4d%4d", &point, &x, &y);
21 printf("%d %d %d\n", point, x, y);
22 if (point != 1 || x != 1234 || y != 9876)
23 abort ();
24 return 0;