Newer
Older
Scratch / mobius / src / libc / string / stricmp.c
@Christopher W. Olsen Christopher W. Olsen on 25 Oct 2019 447 bytes Scratch
#define isupper(ch)	((ch) >= 'A' && (ch) <= 'Z')
#define tolower(ch)	(isupper(ch) ? (ch) - 'A' + 'a' : (ch))

/*****************************************************************************
*****************************************************************************/
int stricmp(const char *str1, const char *str2) /* string.h */
{
	while((*str2 != '\0') && (tolower(*str1) == tolower(*str2)))
	{
		str1++;
		str2++;
	}
	return *str1 -  *str2;
}