Implemented _mbsnbcat.

This commit is contained in:
Michael Stefaniuc 2003-02-14 23:26:58 +00:00 committed by Alexandre Julliard
parent cf27a7fa3b
commit 909ffb7930
2 changed files with 28 additions and 1 deletions

View File

@ -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.@)
*/

View File

@ -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)