home *** CD-ROM | disk | FTP | other *** search
- /* > 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);
- }
-