xref: /reactos/sdk/lib/crt/wstring/wcsnicmp.c (revision c2c66aff)
1 /*
2  * COPYRIGHT:   See COPYING in the top level directory
3  * PROJECT:     ReactOS system libraries
4  * FILE:        lib/sdk/crt/wstring/wcsnicmp.c
5  * PURPOSE:     Unknown
6  * PROGRAMER:   Unknown
7  * UPDATE HISTORY:
8  *              25/11/05: Added license header
9  */
10 
11 #include <precomp.h>
12 
13 /*
14  * @implemented
15  */
_wcsnicmp(const wchar_t * cs,const wchar_t * ct,size_t count)16 int CDECL _wcsnicmp (const wchar_t *cs, const wchar_t *ct, size_t count)
17 {
18 	if (count == 0)
19 		return 0;
20 	do {
21 		if (towupper(*cs) != towupper(*ct++))
22 			return towupper(*cs) - towupper(*--ct);
23 		if (*cs++ == 0)
24 			break;
25 	} while (--count != 0);
26 	return 0;
27 }
28