git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9698
d7cf8633-e32d-0410-b094-
e92efae38249
int u8_fromchar(Uchar w, char *to, size_t maxlen)
{
if (maxlen < 1)
- return -2;
+ return 0;
if (!w)
- return -5;
+ return 0;
if (w >= 0xE000 && !utf8_enable.integer)
w -= 0xE000;
to[0] = 0xE0 | w;
return 4;
}
- return -1;
+ return 0;
}
/** uses u8_fromchar on a static buffer
return 0;
for (i = 0; wcs[i] && i < maxlen-1; ++i)
{
+ /*
int len;
if ( (len = u8_fromchar(wcs[i], mb, maxlen - i)) < 0)
return (mb - start);
mb += len;
+ */
+ mb += u8_fromchar(wcs[i], mb, maxlen - i);
}
*mb = 0;
return (mb - start);
*status_return = XLookupKeySym;
*keysym_return = keysym;
}
+ *uch = 0;
return;
}