48d9570493fe0a236f1dc4916226038bc8708fd9
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS system libraries
4 * FILE: lib/msvcrt/mbstring/mbsncmp.c
5 * PURPOSE: Compares two strings to a maximum of n bytes or characters
6 * PROGRAMER: Boudewijn Dekker
16 int _mbsncmp(const unsigned char *str1
, const unsigned char *str2
, size_t n
)
18 unsigned char *s1
= (unsigned char *)str1
;
19 unsigned char *s2
= (unsigned char *)str2
;
21 unsigned short *short_s1
, *short_s2
;
45 short_s1
= (unsigned short *)s1
;
46 short_s2
= (unsigned short *)s2
;
47 if ( *short_s1
!= *short_s2
)
48 return *short_s1
- *short_s2
;
65 int _mbsnbcmp(const unsigned char *str1
, const unsigned char *str2
, size_t n
)
67 unsigned char *s1
= (unsigned char *)str1
;
68 unsigned char *s2
= (unsigned char *)str2
;
70 unsigned short *short_s1
, *short_s2
;
94 short_s1
= (unsigned short *)s1
;
95 short_s2
= (unsigned short *)s2
;
96 if ( *short_s1
!= *short_s2
)
97 return *short_s1
- *short_s2
;