diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2013-06-12 16:44:23 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2013-06-12 16:44:23 +0000 |
commit | c710be29d5b3ed61094e3146cba2282504276380 (patch) | |
tree | 9017e713fcbe3be16004bdd78e7f39422bde6c3b /sys/lib | |
parent | bdae52344f18e9626da9bbe0bbf5412adac04ea8 (diff) |
From now on, the MI libkern memcpy should not do overlap handling.
Diffstat (limited to 'sys/lib')
-rw-r--r-- | sys/lib/libkern/memcpy.c | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/sys/lib/libkern/memcpy.c b/sys/lib/libkern/memcpy.c index 7977d998674..962a967a057 100644 --- a/sys/lib/libkern/memcpy.c +++ b/sys/lib/libkern/memcpy.c @@ -1,5 +1,4 @@ -/* $OpenBSD: memcpy.c,v 1.2 2009/01/25 22:06:44 grange Exp $ */ -/* $NetBSD: bcopy.c,v 1.5 1995/04/22 13:46:50 cgd Exp $ */ +/* $OpenBSD: memcpy.c,v 1.3 2013/06/12 16:44:22 deraadt Exp $ */ /*- * Copyright (c) 1993 @@ -28,8 +27,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * @(#)bcopy.c 8.1 (Berkeley) 6/11/93 */ #include <sys/types.h> @@ -39,21 +36,12 @@ * This is designed to be small, not fast. */ void * -memcpy(s1, s2, n) - void *s1; - const void *s2; - size_t n; +memcpy(void *s1, const void *s2, size_t n) { register const char *f = s2; register char *t = s1; - if (f < t) { - f += n; - t += n; - while (n-- > 0) - *--t = *--f; - } else - while (n-- > 0) - *t++ = *f++; + while (n-- > 0) + *t++ = *f++; return s1; } |