home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
GEMini Atari
/
GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso
/
zip
/
mint
/
mntlib16.lzh
/
MNTLIB16
/
MEMCMP.C
< prev
next >
Wrap
C/C++ Source or Header
|
1993-08-03
|
444b
|
31 lines
/* from Henry Spencer's stringlib */
#include <stddef.h>
#include <string.h>
/*
* memcmp - compare bytes
*/
int /* <0, == 0, >0 */
memcmp(s1, s2, size)
const void * s1;
const void * s2;
size_t size;
{
register const char *scan1;
register const char *scan2;
register size_t n;
scan1 = s1;
scan2 = s2;
for (n = size; n > 0; n--)
if (*scan1 == *scan2) {
scan1++;
scan2++;
} else
return(*scan1 - *scan2);
return(0);
}