2.9
[glibc/nacl-glibc.git] / string / bug-strcoll1.c
blobb6510d926fb37cf6b1588ccb3f3a1beccffedc70
1 #include <stdio.h>
2 #include <string.h>
3 #include <locale.h>
5 int
6 main (void)
8 const char t1[] = "0-0-0-0-0-0-0-0-0-0.COM";
9 const char t2[] = "00000-00000.COM";
10 int res1;
11 int res2;
13 setlocale (LC_ALL, "en_US.ISO-8859-1");
15 res1 = strcoll (t1, t2);
16 printf ("strcoll (\"%s\", \"%s\") = %d\n", t1, t2, res1);
17 res2 = strcoll (t2, t1);
18 printf ("strcoll (\"%s\", \"%s\") = %d\n", t2, t1, res2);
20 return ((res1 == 0 && res2 != 0)
21 || (res1 != 0 && res2 == 0)
22 || (res1 < 0 && res2 < 0)
23 || (res1 > 0 && res2 > 0));