diff options
author | Frank Busse <bb0xfb@gmail.com> | 2020-12-01 10:42:53 +0000 |
---|---|---|
committer | Cristian Cadar <c.cadar@imperial.ac.uk> | 2020-12-23 16:40:30 +0000 |
commit | b605851ac60827687b1f48fbd3971703de555654 (patch) | |
tree | 5c9336708c94bc47fd728d6d8e16dc8509004e8b /runtime/klee-libc/mempcpy.c | |
parent | 302fae71de57d368505071637b3b0de539cf296b (diff) | |
download | klee-b605851ac60827687b1f48fbd3971703de555654.tar.gz |
klee-libc: simplify mempcpy
Diffstat (limited to 'runtime/klee-libc/mempcpy.c')
-rw-r--r-- | runtime/klee-libc/mempcpy.c | 11 |
1 files changed, 4 insertions, 7 deletions
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 <stdlib.h> +#undef _GNU_SOURCE -void *mempcpy(void *destaddr, void const *srcaddr, size_t len) { - char *dest = destaddr; - char const *src = srcaddr; +#include <string.h> - while (len-- > 0) - *dest++ = *src++; - return dest; +void *mempcpy(void *destaddr, void const *srcaddr, size_t len) { + return (char *)memcpy(destaddr, srcaddr, len) + len; } |