Hello,
this code
int
main (void)
{
int i;
char pmbbuf[4];
wchar_t *pwchello = L"1234567890123456789012345678901234567890";
i = wcstombs (pmbbuf, pwchello, wcslen(pwchello)* MB_CUR_MAX + 1);
printf("%d\n", MB_CUR_MAX);
printf (" Characters converted: %u\n", i);
printf (" Multibyte character: %s\n\n", pmbbuf);
return 0;
}
and the strange thing is that it compiles with no warnings.
when I run ./a.out it printed 1 Characters converted: 40 Multibyte character: 1234(
Segmentation fault
Any ideas for the seg fault?
TIA, cateof