/*  strncmp.c -- Compare two strings with length qualifier
 *
 * Compare strings (at most n bytes):  s1>s2: >0  s1==s2: 0  s1<s2: <0
 */
#include "vctype.h"

strncmp(s1, s2, n)
register char *s1, *s2;
register n;
{
	int x;
	while (--n >= 0 && ((x = toupper(*s1) - toupper(*s2)) == 0))
		if (s1++, *s2++ == '\0')
			return(0);
	return(n<0 ? 0 : x);
}

