home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Unix System Administration Handbook 1997 October
/
usah_oct97.iso
/
news
/
cnews.tar
/
libfake
/
memcmp.c
< prev
next >
Wrap
C/C++ Source or Header
|
1989-05-27
|
339b
|
26 lines
/*
* memcmp - compare bytes
*/
int /* <0, == 0, >0 */
memcmp(s1, s2, size)
char * s1;
char * s2;
int size;
{
register char *scan1;
register char *scan2;
register int n;
scan1 = s1;
scan2 = s2;
for (n = size; n > 0; n--)
if (*scan1 == *scan2) {
scan1++;
scan2++;
} else
return(*scan1 - *scan2);
return(0);
}