Update.
[platform/upstream/glibc.git] / stdio-common / bug14.c
1 /* Test case by Al Viro <aviro@redhat.com>.  */
2 #include <locale.h>
3 #include <wchar.h>
4 #include <stdio.h>
5
6 /* MB_CUR_MAX multibyte ones (6 UTF+0080, in this case) */
7 static const char string[] = "\
8 \xc2\x80\xc2\x80\xc2\x80\xc2\x80\xc2\x80\xc2\x80";
9
10 int
11 main (void)
12 {
13   if (setlocale (LC_ALL, "de_DE.utf8") == NULL)
14     {
15       puts ("cannot set locale");
16       exit (1);
17     }
18
19   wchar_t s[7];
20   int n = sscanf (string, "%l[\x80\xc2]", s);
21   if (n != 1)
22     {
23       printf ("return values %d != 1\n", n);
24       exit (1);
25     }
26
27   return 0;
28 }