home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Datafile PD-CD 4
/
DATAFILE_PDCD4.iso
/
unix
/
unixtools
/
util
/
c
/
strnlcmp
< prev
next >
Wrap
Text File
|
1992-07-21
|
419b
|
18 lines
/* > C.Strnlcmp - compare two strings for n bytes, ignoring case */
#include <ctype.h>
#include "utils.h"
int strnlcmp (const char *s, const char *t, int n)
{
while ( --n >= 0 )
{
if ( *s == '\0' || *t == '\0' || tolower(*s) != tolower(*t) )
return (tolower(*s) - tolower(*t));
++s;
++t;
}
return (0);
}