Piotr Caban (@piotr) commented about dlls/msvcrt/mbcs.c:
/*********************************************************************
_mbsncpy(MSVCRT.@)
_mbsncpy_l(MSVCRT.@)
- REMARKS
- The parameter n is the number or characters to copy, not the size of
- the buffer. Use _mbsnbcpy for a function analogical to strncpy
*/
- the buffer. Use _mbsnbcpy_l for a function analogical to strncpy
-unsigned char* CDECL _mbsncpy(unsigned char* dst, const unsigned char* src, size_t n) +unsigned char* CDECL _mbsncpy_l(unsigned char* dst, const unsigned char* src, size_t n, _locale_t locale) {
- unsigned char* ret = dst;
- if(!n)
- return dst;
It's also breaking `n == 0` case.