Implemented _mbsnbcat.
This commit is contained in:
parent
cf27a7fa3b
commit
909ffb7930
|
@ -931,6 +931,33 @@ MSVCRT_size_t _mbsnbcnt(const unsigned char* str, MSVCRT_size_t len)
|
|||
}
|
||||
|
||||
|
||||
/*********************************************************************
|
||||
* _mbsnbcat(MSVCRT.@)
|
||||
*/
|
||||
unsigned char* _mbsnbcat(unsigned char* dst, const unsigned char* src, MSVCRT_size_t len)
|
||||
{
|
||||
if(MSVCRT___mb_cur_max > 1)
|
||||
{
|
||||
char *res = dst;
|
||||
while (*dst) {
|
||||
if (MSVCRT_isleadbyte(*dst++)) {
|
||||
if (*dst) {
|
||||
dst++;
|
||||
} else {
|
||||
/* as per msdn overwrite the lead byte in front of '\0' */
|
||||
dst--;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
while (*src && len--) *dst++ = *src++;
|
||||
*dst = '\0';
|
||||
return res;
|
||||
}
|
||||
return strncat(dst, src, len); /* ASCII CP */
|
||||
}
|
||||
|
||||
|
||||
/*********************************************************************
|
||||
* _mbsncat(MSVCRT.@)
|
||||
*/
|
||||
|
|
|
@ -359,7 +359,7 @@
|
|||
@ cdecl _mbsinc(str) _mbsinc
|
||||
@ cdecl _mbslen(str) _mbslen
|
||||
@ cdecl _mbslwr(str) _mbslwr
|
||||
@ stub _mbsnbcat #(str str long)
|
||||
@ cdecl _mbsnbcat (str str long) _mbsnbcat
|
||||
@ cdecl _mbsnbcmp(str str long) _mbsnbcmp
|
||||
@ cdecl _mbsnbcnt(ptr long) _mbsnbcnt
|
||||
@ stub _mbsnbcoll #(str str long)
|
||||
|
|
Loading…
Reference in New Issue