diff options
author | 2019-04-20 22:59:03 +0000 | |
---|---|---|
committer | 2019-04-20 22:59:03 +0000 | |
commit | 7a2189da75c696c4404ba58cd970151833ffe027 (patch) | |
tree | 8ed98a3e248346d83f1e2aed4bcb9035ef714558 /sys/lib/libsa/memcpy.c | |
parent | armv7 RAMDISK is now compiled with -Oz (just to be like other ramdisks), (diff) | |
download | wireguard-openbsd-7a2189da75c696c4404ba58cd970151833ffe027.tar.xz wireguard-openbsd-7a2189da75c696c4404ba58cd970151833ffe027.zip |
libsa's memcpy() is actually memmove(). make a proper memmove(), and give
memcpy() correct behaviour. This also brings the bcopy() macro into line.
Diffstat (limited to 'sys/lib/libsa/memcpy.c')
-rw-r--r-- | sys/lib/libsa/memcpy.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/sys/lib/libsa/memcpy.c b/sys/lib/libsa/memcpy.c index 15425355490..65e95d66cef 100644 --- a/sys/lib/libsa/memcpy.c +++ b/sys/lib/libsa/memcpy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: memcpy.c,v 1.5 2003/08/08 03:36:07 deraadt Exp $ */ +/* $OpenBSD: memcpy.c,v 1.6 2019/04/20 22:59:04 deraadt Exp $ */ /* $NetBSD: bcopy.c,v 1.5 1995/04/22 13:46:50 cgd Exp $ */ /*- @@ -44,13 +44,7 @@ memcpy(void *s1, const void *s2, size_t n) const char *f = s2; 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; } |