about summary refs log tree commit diff homepage
path: root/runtime
diff options
context:
space:
mode:
authorFrank Busse <bb0xfb@gmail.com>2020-12-01 10:42:53 +0000
committerCristian Cadar <c.cadar@imperial.ac.uk>2020-12-23 16:40:30 +0000
commitb605851ac60827687b1f48fbd3971703de555654 (patch)
tree5c9336708c94bc47fd728d6d8e16dc8509004e8b /runtime
parent302fae71de57d368505071637b3b0de539cf296b (diff)
downloadklee-b605851ac60827687b1f48fbd3971703de555654.tar.gz
klee-libc: simplify mempcpy
Diffstat (limited to 'runtime')
-rw-r--r--runtime/klee-libc/mempcpy.c11
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;
 }