Blame src/string/ntapi_tt_strncmp_utf16.c

a2ea1b
/********************************************************/
a2ea1b
/*  ntapi: Native API core library                      */
a2ea1b
/*  Copyright (C) 2013--2016  Z. Gilboa                 */
a2ea1b
/*  Released under GPLv2 and GPLv3; see COPYING.NTAPI.  */
a2ea1b
/********************************************************/
a2ea1b
a2ea1b
#include <psxtypes/psxtypes.h>
a2ea1b
#include <ntapi/nt_string.h>
a2ea1b
a2ea1b
int __cdecl __ntapi_tt_strncmp_utf16(
a2ea1b
	__in	const wchar16_t * a,
a2ea1b
	__in	const wchar16_t * b,
a2ea1b
	__in	size_t		  n)
a2ea1b
{
a2ea1b
	if ((n /= sizeof(wchar16_t)) == 0)
a2ea1b
		return 0;
a2ea1b
a2ea1b
	for (--n; n && (*a == *b) && *a; a++, b++)
a2ea1b
		n--;
a2ea1b
a2ea1b
	return (int)*a - (int)*b;
a2ea1b
}