home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 8 / CDASC08.ISO / NEWS / RADIANCE / SRC / COMMON / STRCMP.C < prev    next >
Text File  |  1993-10-07  |  412b  |  25 lines

  1. /* Copyright (c) 1992 Regents of the University of California */
  2.  
  3. #ifndef lint
  4. static char SCCSid[] = "@(#)strcmp.c 2.1 8/4/92 LBL";
  5. #endif
  6.  
  7. /*
  8.  * String comparison routine optimized for use with savestr.c
  9.  */
  10.  
  11.  
  12. int
  13. strcmp(s1, s2)                /* check for s1==s2 */
  14. register char  *s1, *s2;
  15. {
  16.     if (s1 == s2)
  17.         return(0);
  18.  
  19.     while (*s1 == *s2++)
  20.         if (!*s1++)
  21.             return(0);
  22.  
  23.     return(*s1 - *--s2);
  24. }
  25.