Allow strptime read outputs from strftime. Fixes bug 4772.
[glibc.git] / stdio-common / bug9.c
blob732904d7316c956041d60787ad5559245e774add
1 #include <stdio.h>
2 #include <string.h>
4 int
5 main(int argc, char *argv[])
7 char buf[100];
8 int a, b;
9 int status = 0;
11 sscanf ("12ab", "%dab%n", &a, &b);
12 sprintf (buf, "%d, %d", a, b);
13 puts (buf);
14 status |= strcmp (buf, "12, 4");
16 sscanf ("12ab100", "%dab%n100", &a, &b);
17 sprintf (buf, "%d, %d", a, b);
18 puts (buf);
19 status |= strcmp (buf, "12, 4");
21 return status;