2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS system libraries
4 * FILE: lib/msvcrt/mbstring/mbsncpy.c
5 * PURPOSE: Copies a string to a maximum of n bytes or characters
6 * PROGRAMER: Boudewijn Dekker
11 #include <msvcrt/mbstring.h>
17 unsigned char* _mbsncpy(unsigned char *str1, const unsigned char *str2, size_t n)
19 unsigned char *s1 = (unsigned char *)str1;
20 unsigned char *s2 = (unsigned char *)str2;
22 unsigned short *short_s1, *short_s2;
31 if ( !_ismbblead(*s2) ) {
39 short_s1 = (unsigned short *)s1;
40 short_s2 = (unsigned short *)s2;
41 *short_s1 = *short_s2;
52 * The _mbsnbcpy function copies count bytes from src to dest. If src is shorter
53 * than dest, the string is padded with null characters. If dest is less than or
54 * equal to count it is not terminated with a null character.
58 unsigned char * _mbsnbcpy(unsigned char *str1, const unsigned char *str2, size_t n)
60 unsigned char *s1 = (unsigned char *)str1;
61 unsigned char *s2 = (unsigned char *)str2;
63 unsigned short *short_s1, *short_s2;
74 if ( !_ismbblead(*s2) ) {
82 short_s1 = (unsigned short *)s1;
83 short_s2 = (unsigned short *)s2;
84 *short_s1 = *short_s2;