home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume5 / smallc / part3 / lib / strcmp.c < prev    next >
Encoding:
C/C++ Source or Header  |  1986-11-30  |  174 b   |  14 lines

  1. /*
  2.  * Compare strings:  s1>s2: >0  s1==s2: 0  s1<s2: <0
  3.  */
  4.  
  5. strcmp(s1, s2)
  6. char *s1, *s2;
  7. {
  8.  
  9.     while (*s1 == *s2++)
  10.         if (*s1++=='\0')
  11.             return(0);
  12.     return(*s1 - *--s2);
  13.     }
  14.