File: strncasecmp.c

package info (click to toggle)
ifmail 2.14tx8.10-32
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,056 kB
  • sloc: ansic: 30,328; perl: 4,955; yacc: 839; makefile: 716; sh: 424; cpp: 235; lex: 206; awk: 24
file content (14 lines) | stat: -rw-r--r-- 220 bytes parent folder | download | duplicates (17)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <ctype.h>

int
strncasecmp(s1,s2,n)
register unsigned char *s1, *s2;
register int n;
{
	while (*s1 && *s2 && (toupper(*s1) == toupper(*s2)) && --n)
	{
		s1++;
		s2++;
	}
	return (toupper(*s1) - toupper(*s2));
}