From b605851ac60827687b1f48fbd3971703de555654 Mon Sep 17 00:00:00 2001 From: Frank Busse Date: Tue, 1 Dec 2020 10:42:53 +0000 Subject: klee-libc: simplify mempcpy --- runtime/klee-libc/mempcpy.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'runtime') diff --git a/runtime/klee-libc/mempcpy.c b/runtime/klee-libc/mempcpy.c index 31712251..c1cc175c 100644 --- a/runtime/klee-libc/mempcpy.c +++ b/runtime/klee-libc/mempcpy.c @@ -7,13 +7,10 @@ // //===----------------------------------------------------------------------===*/ -#include +#undef _GNU_SOURCE -void *mempcpy(void *destaddr, void const *srcaddr, size_t len) { - char *dest = destaddr; - char const *src = srcaddr; +#include - while (len-- > 0) - *dest++ = *src++; - return dest; +void *mempcpy(void *destaddr, void const *srcaddr, size_t len) { + return (char *)memcpy(destaddr, srcaddr, len) + len; } -- cgit 1.4.1