strcasecmp.c 251 B

123456789
  1. #include <strings.h>
  2. #include <ctype.h>
  3. int strcasecmp(const char *_l, const char *_r)
  4. {
  5. const unsigned char *l=(void *)_l, *r=(void *)_r;
  6. for (; *l && *r && (*l == *r || tolower(*l) == tolower(*r)); l++, r++);
  7. return tolower(*l) - tolower(*r);
  8. }