home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 8
/
CDASC08.ISO
/
NEWS
/
RADIANCE
/
SRC
/
COMMON
/
STRCMP.C
< prev
next >
Wrap
Text File
|
1993-10-07
|
412b
|
25 lines
/* Copyright (c) 1992 Regents of the University of California */
#ifndef lint
static char SCCSid[] = "@(#)strcmp.c 2.1 8/4/92 LBL";
#endif
/*
* String comparison routine optimized for use with savestr.c
*/
int
strcmp(s1, s2) /* check for s1==s2 */
register char *s1, *s2;
{
if (s1 == s2)
return(0);
while (*s1 == *s2++)
if (!*s1++)
return(0);
return(*s1 - *--s2);
}