Back to index

radiance  4R0+20100331
strcmp.c
Go to the documentation of this file.
00001 #ifndef lint
00002 static const char    RCSid[] = "$Id: strcmp.c,v 2.3 2003/02/25 02:47:22 greg Exp $";
00003 #endif
00004 /*
00005  * String comparison routine optimized for use with savestr.c
00006  */
00007 
00008 #include "copyright.h"
00009 
00010 
00011 int
00012 strcmp(s1, s2)                            /* check for s1==s2 */
00013 register char  *s1, *s2;
00014 {
00015        if (s1 == s2)
00016               return(0);
00017 
00018        while (*s1 == *s2++)
00019               if (!*s1++)
00020                      return(0);
00021 
00022        return(*s1 - *--s2);
00023 }