/* helper routine for returning string descriptors in UTF-16LE input can actually be ISO-8859-1; ASCII is its 7-bit subset  */
static int ascii2utf(char *s, u8 *utf, int utfmax)
/* helper routine for returning string descriptors in UTF-16LE input can actually be ISO-8859-1; ASCII is its 7-bit subset  */
static int ascii2utf(char *s, u8 *utf, int utfmax)
{
	int retval;
	for (retval = 0; *s && utfmax > 1; utfmax -= 2, retval += 2) {
		*utf++ = *s++;
		*utf++ = 0;
	}
	return retval;
}