Piotr Caban (@piotr) commented about dlls/msvcrt/mbcs.c:
- /* Lead bytes can also be trail bytes so we need to analyse the string.
- Also we must return _MBC_ILLEGAL for chars past the end of the string
- */
- while (str < end) /* Note: we skip the last byte - will check after the loop */
- {
if (!*str)
return _MBC_ILLEGAL;
lead = mbcinfo->ismbcodepage && !lead && _ismbblead_l(*str, locale);
str++;
- }
- if (lead)
if (_ismbbtrail_l(*str, locale))
return _MBC_TRAIL;
else
return _MBC_ILLEGAL;
```suggestion:-4+0 if (lead) { if (_ismbbtrail_l(*str, locale)) return _MBC_TRAIL; else return _MBC_ILLEGAL; } ```