print_wchar_str(const pg_wchar *s)
{
#define BUF_DIGITS 50
- static char buf[BUF_DIGITS * 2 + 1];
+ static char buf[BUF_DIGITS * 11 + 1];
int i;
+ char *p;
i = 0;
+ p = buf;
while (*s && i < BUF_DIGITS)
{
- snprintf(&buf[i * 2], 3, "%04X", *s);
+ p += sprintf(p, "U+%04X ", *s);
i++;
s++;
}
- buf[i * 2] = '\0';
+ *p = '\0';
+
return buf;
}
if (pg_wcscmp(test->output, result) != 0)
{
printf("FAILURE (NormalizationTest.txt line %d):\n", test->linenum);
- printf("input:\t%s\n", print_wchar_str(test->input));
- printf("expected:\t%s\n", print_wchar_str(test->output));
- printf("got\t%s\n", print_wchar_str(result));
+ printf("input: %s\n", print_wchar_str(test->input));
+ printf("expected: %s\n", print_wchar_str(test->output));
+ printf("got: %s\n", print_wchar_str(result));
printf("\n");
exit(1);
}