Jacek Caban (@jacek) commented about dlls/kernelbase/path.c:
src += 3;
}
else
{
utf8_len = i;
break;
}
}
utf16_len = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, utf8_buf, utf8_len, NULL, 0);
if (!utf16_len)
continue;
else
{
MultiByteToWideChar(CP_UTF8, 0, utf8_buf, utf8_len, utf16_buf, utf16_len);
utf16_buf[utf16_len] = 0;
There is no need for null-termination, you have utf16_len available, so you could use that when copying the result.