Commit | Line | Data |
---|---|---|
dba1d438 KM |
1 | /* |
2 | * Copyright (c) 1987 Regents of the University of California. | |
acca4551 KB |
3 | * All rights reserved. |
4 | * | |
019bea33 | 5 | * %sccs.include.redist.c% |
dba1d438 KM |
6 | */ |
7 | ||
8 | #if defined(LIBC_SCCS) && !defined(lint) | |
46b5f26a | 9 | static char sccsid[] = "@(#)bcmp.c 5.6 (Berkeley) %G%"; |
acca4551 | 10 | #endif /* LIBC_SCCS and not lint */ |
dba1d438 | 11 | |
80acdbfd KB |
12 | #include <string.h> |
13 | ||
dba1d438 KM |
14 | /* |
15 | * bcmp -- vax cmpc3 instruction | |
16 | */ | |
17 | bcmp(b1, b2, length) | |
46b5f26a | 18 | const void *b1, *b2; |
80acdbfd | 19 | register size_t length; |
dba1d438 | 20 | { |
46b5f26a | 21 | register char *p1, *p2; |
dba1d438 KM |
22 | |
23 | if (length == 0) | |
80acdbfd | 24 | return(0); |
46b5f26a KB |
25 | p1 = (char *)b1; |
26 | p2 = (char *)b2; | |
dba1d438 | 27 | do |
46b5f26a | 28 | if (*p1++ != *p2++) |
dba1d438 KM |
29 | break; |
30 | while (--length); | |
31 | return(length); | |
32 | } |