
#include <ctype.h>
#include <string.h>

/*
** strnicmp() - Compare n nr of chars in two strings incasesensitivly.
**
** Made by Kasper B. Graversen (c) 1996
**
** This is freeware - use at own risc.
*/

int strnicmp(const char *str1, const char *str2, size_t n)
{
    while((--n) && (tolower(*str1) == tolower(*str2)))
    {
        if(!*str1)
            return(0);

        str1++;
        str2++;
    }

    return(*str1 - *str2);
}



