Update. Old logs are in ChangeLog.7.
[glibc.git] / stdio-common / scanf4.c
blob177b2ec22f0a024a979bd30a0a94fd2ddf0c6f54
1 #include <stdio.h>
3 int
4 main(int arc, char *argv[])
6 int res;
7 unsigned int val;
9 FILE *fp = fopen ("/dev/null", "r");
11 val = 0;
12 res = fscanf(fp, "%n", &val);
14 printf("Result of fscanf %%n = %d\n", res);
15 printf("Scanned format = %d\n", val);
17 res = fscanf(fp, "");
18 printf("Result of fscanf \"\" = %d\n", res);
19 if (res != 0)
20 abort ();
22 res = fscanf(fp, "BLURB");
23 printf("Result of fscanf \"BLURB\" = %d\n", res);
24 if (res >= 0)
25 abort ();
27 fclose (fp);
29 return 0;
30 return 0;