2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS system libraries
4 * FILE: lib/crtdll/mbstring/mbsset.c
5 * PURPOSE: Concatenate two multi byte string to maximum of n characters or bytes
6 * PROGRAMER: Boudewijn Dekker
11 #include <msvcrt/mbstring.h>
12 #include <msvcrt/string.h>
14 size_t _mbclen2(const unsigned int s);
16 unsigned char * _mbsncat(unsigned char *dst, const unsigned char *src, size_t n)
18 char *d = (char *)dst;
19 char *s = (char *)src;
21 d = dst + strlen(dst); // get the end of string
22 d += _mbclen2(*d); // move 1 or 2 up
25 if ((*d++ = *s++) == 0)
38 unsigned char * _mbsnbcat(unsigned char *dst, const unsigned char *src, size_t n)
41 char *s = (char *)src;
43 d = dst + strlen(dst); // get the end of string
44 d += _mbclen2(*d); // move 1 or 2 up
47 if ((*d++ = *s++) == 0)
53 if ( !(n==1 && _ismbblead(*s)) )