Lines 20-26
Link Here
|
20 |
//'buf' from being overrun. (We can tell afterwards, but by |
20 |
//'buf' from being overrun. (We can tell afterwards, but by |
21 |
//then it's too late.) |
21 |
//then it's too late.) |
22 |
|
22 |
|
23 |
i = utf8_mbstowcs((wchar_t *)ob, ib, max_i); |
23 |
i = utf8s_to_utf16s(ib, max_i, (wchar_t *)ob); |
24 |
BUG_ON(i > max_o/sizeof(wchar_t)); |
24 |
BUG_ON(i > max_o/sizeof(wchar_t)); |
25 |
|
25 |
|
26 |
return 0; |
26 |
return 0; |
Lines 29-35
Link Here
|
29 |
{ |
29 |
{ |
30 |
int i = 0; |
30 |
int i = 0; |
31 |
|
31 |
|
32 |
i = utf8_wcstombs(ob, (wchar_t *)ib, max_o); |
32 |
// Patcher's note: UTF16_HOST_ENDIAN may not work right -- todo: fixme |
|
|
33 |
i = utf16s_to_utf8s((wchar_t *)ib, max_i, UTF16_HOST_ENDIAN, ob, max_o); |
33 |
BUG_ON(i >= max_o); |
34 |
BUG_ON(i >= max_o); |
34 |
ob[i] = '\0'; |
35 |
ob[i] = '\0'; |
35 |
|
36 |
|