xref: /csrg-svn/lib/libc/string/memcmp.c (revision 26527)
124195Skre /*
224195Skre  * Copyright (c) 1985 Regents of the University of California.
324195Skre  * All rights reserved.  The Berkeley software License Agreement
424195Skre  * specifies the terms and conditions for redistribution.
524195Skre  */
624195Skre 
724195Skre /*
824195Skre  * Sys5 compat routine
924195Skre  */
1024195Skre 
11*26527Sdonn #if defined(LIBC_SCCS) && !defined(lint)
12*26527Sdonn static char sccsid[] = "@(#)memcmp.c	5.2 (Berkeley) 86/03/09";
1324195Skre #endif
1424195Skre 
1524195Skre memcmp(s1, s2, n)
1624195Skre 	register char *s1, *s2;
1724195Skre 	register n;
1824195Skre {
1924195Skre 	while (--n >= 0)
2024195Skre 		if (*s1++ != *s2++)
2124195Skre 			return (*--s1 - *--s2);
2224195Skre 	return (0);
2324195Skre }
24