bcmp.c (8fb3f3f68288ae2b1b53dd65e3dd673d83c80f4c) bcmp.c (9abf5797a0987be44fffbdf7fe99714c956b8350)
1/*
2 * Copyright (c) 1987, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 23 unchanged lines hidden (view full) ---

32 */
33
34#if defined(LIBC_SCCS) && !defined(lint)
35static char sccsid[] = "@(#)bcmp.c 8.1 (Berkeley) 6/4/93";
36#endif /* LIBC_SCCS and not lint */
37#include <sys/cdefs.h>
38__FBSDID("$FreeBSD$");
39
1/*
2 * Copyright (c) 1987, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 23 unchanged lines hidden (view full) ---

32 */
33
34#if defined(LIBC_SCCS) && !defined(lint)
35static char sccsid[] = "@(#)bcmp.c 8.1 (Berkeley) 6/4/93";
36#endif /* LIBC_SCCS and not lint */
37#include <sys/cdefs.h>
38__FBSDID("$FreeBSD$");
39
40#include <string.h>
40#include <strings.h>
41
42/*
43 * bcmp -- vax cmpc3 instruction
44 */
45int
41
42/*
43 * bcmp -- vax cmpc3 instruction
44 */
45int
46bcmp(b1, b2, length)
47 const void *b1, *b2;
48 size_t length;
46bcmp(const void *b1, const void *b2, size_t length)
49{
50 char *p1, *p2;
51
52 if (length == 0)
47{
48 char *p1, *p2;
49
50 if (length == 0)
53 return(0);
51 return (0);
54 p1 = (char *)b1;
55 p2 = (char *)b2;
56 do
57 if (*p1++ != *p2++)
58 break;
59 while (--length);
52 p1 = (char *)b1;
53 p2 = (char *)b2;
54 do
55 if (*p1++ != *p2++)
56 break;
57 while (--length);
60 return(length);
58 return (length);
61}
59}