Use Linux 5.15 in build-many-glibcs.py
[glibc.git] / stdio-common / bug18.c
blob2e4c378c134f762f9504aa0ded952484cd114aa2
1 #include <assert.h>
2 #include <errno.h>
3 #include <stdio.h>
5 #ifndef CHAR
6 # define CHAR char
7 # define L(str) str
8 # define SSCANF sscanf
9 #endif
12 static int
13 do_test (void)
15 printf("setting errno to EINTR\n");
16 errno = EINTR;
18 printf("checking sscanf\n");
20 CHAR str[] = L("7-11");
21 int i, j, n;
23 i = j = n = 0;
24 SSCANF (str, L(" %i - %i %n"), &i, &j, &n);
25 printf ("found %i-%i (length=%i)\n", i, j, n);
27 int result = 0;
28 if (i != 7)
30 printf ("i is %d, expected 7\n", i);
31 result = 1;
33 if (j != 11)
35 printf ("j is %d, expected 11\n", j);
36 result = 1;
38 if (n != 4)
40 printf ("n is %d, expected 4\n", j);
41 result = 1;
44 return result;
47 #define TEST_FUNCTION do_test ()
48 #include "../test-skeleton.c"