home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC Extra Super CD 1998 January
/
PCPLUS131.iso
/
DJGPP
/
V2
/
DJLSR201.ZIP
/
src
/
libc
/
compat
/
string
/
strnicmp.c
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
C/C++ Source or Header
|
1995-11-16
|
378 b
|
19 lines
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#include <string.h>
#include <ctype.h>
int
strnicmp(const char *s1, const char *s2, size_t n)
{
if (n == 0)
return 0;
do {
if (tolower(*s1) != tolower(*s2++))
return (int)tolower(*s1) - (int)tolower(*--s2);
if (*s1++ == 0)
break;
} while (--n != 0);
return 0;
}