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);
19 unsigned char * _mbsncat(unsigned char *dst, const unsigned char *src, size_t n)
21 char *d = (char *)dst;
22 char *s = (char *)src;
24 d = dst + strlen(dst); // get the end of string
25 d += _mbclen2(*d); // move 1 or 2 up
28 if ((*d++ = *s++) == 0)
44 unsigned char * _mbsnbcat(unsigned char *dst, const unsigned char *src, size_t n)
47 char *s = (char *)src;
49 d = dst + strlen(dst); // get the end of string
50 d += _mbclen2(*d); // move 1 or 2 up
53 if ((*d++ = *s++) == 0)
59 if ( !(n==1 && _ismbblead(*s)) )