2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS system libraries
4 * FILE: lib/crtdll/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;
53 * The _mbsnbcpy function copies count bytes from src to dest. If src is shorter
54 * than dest, the string is padded with null characters. If dest is less than or
55 * equal to count it is not terminated with a null character.
59 unsigned char * _mbsnbcpy(unsigned char *str1, const unsigned char *str2, size_t n)
61 unsigned char *s1 = (unsigned char *)str1;
62 unsigned char *s2 = (unsigned char *)str2;
64 unsigned short *short_s1, *short_s2;
75 if ( !_ismbblead(*s2) ) {
83 short_s1 = (unsigned short *)s1;
84 short_s2 = (unsigned short *)s2;
85 *short_s1 = *short_s2;