Blame src/string/ntapi_tt_strncmp_multibyte.c

964eed
/********************************************************/
964eed
/*  ntapi: Native API core library                      */
59d585
/*  Copyright (C) 2013--2021  Z. Gilboa                 */
964eed
/*  Released under GPLv2 and GPLv3; see COPYING.NTAPI.  */
964eed
/********************************************************/
964eed
964eed
#include <psxtypes/psxtypes.h>
964eed
#include <ntapi/nt_string.h>
766a63
#include "ntapi_impl.h"
964eed
964eed
int __cdecl __ntapi_tt_strncmp_multibyte(
964eed
	__in	const char *	a,
964eed
	__in	const char *	b,
964eed
	__in	size_t		n)
964eed
{
964eed
	if (n == 0)
964eed
		return 0;
964eed
964eed
	for (--n; n && (*a == *b) && *a; a++, b++)
964eed
		n--;
964eed
964eed
	return (int)*a - (int)*b;
964eed
}