Blame stdio-common/bug14.c
|
Packit Service |
82fcde |
/* Test case by Al Viro <aviro@redhat.com>. */
|
|
Packit Service |
82fcde |
#include <locale.h>
|
|
Packit Service |
82fcde |
#include <wchar.h>
|
|
Packit Service |
82fcde |
#include <stdio.h>
|
|
Packit Service |
82fcde |
#include <stdlib.h>
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
/* MB_CUR_MAX multibyte ones (6 UTF+0080, in this case) */
|
|
Packit Service |
82fcde |
static const char string[] = "\
|
|
Packit Service |
82fcde |
\xc2\x80\xc2\x80\xc2\x80\xc2\x80\xc2\x80\xc2\x80";
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
int
|
|
Packit Service |
82fcde |
main (void)
|
|
Packit Service |
82fcde |
{
|
|
Packit Service |
82fcde |
if (setlocale (LC_ALL, "de_DE.UTF-8") == NULL)
|
|
Packit Service |
82fcde |
{
|
|
Packit Service |
82fcde |
puts ("cannot set locale");
|
|
Packit Service |
82fcde |
exit (1);
|
|
Packit Service |
82fcde |
}
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
wchar_t s[7];
|
|
Packit Service |
82fcde |
int n = sscanf (string, "%l[\x80\xc2]", s);
|
|
Packit Service |
82fcde |
if (n != 1)
|
|
Packit Service |
82fcde |
{
|
|
Packit Service |
82fcde |
printf ("return values %d != 1\n", n);
|
|
Packit Service |
82fcde |
exit (1);
|
|
Packit Service |
82fcde |
}
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
return 0;
|
|
Packit Service |
82fcde |
}
|