home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d1xx / d183 / mklib.lha / Mklib / Edlib / strnicmp.c < prev    next >
C/C++ Source or Header  |  1989-02-26  |  407b  |  18 lines

  1. /* edlib  version 1.0 of 04/08/88 */
  2. #include <ctype.h>
  3.  
  4. int strnicmp(str1,str2,len)
  5. char *str1,*str2;
  6. int len;
  7. {
  8.     int index = 0;
  9.  
  10.     while ( str1[index] && str2[index] && index < len &&
  11.             tolower(str1[index]) == tolower(str2[index]) )
  12.         ++index;
  13.  
  14.     return( (tolower(str1[index]) < tolower(str2[index])) ? -1 :
  15.           ( (tolower(str1[index]) > tolower(str2[index])) ?  1 : 0) );
  16. }
  17.  
  18.