Commit 909ffb79 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

Implemented _mbsnbcat.

parent cf27a7fa
......@@ -932,6 +932,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.@)
*/
unsigned char* _mbsncat(unsigned char* dst, const unsigned char* src, MSVCRT_size_t len)
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment