From d07bd08dd0446e8c41eccaccbb07e9112200e8ee Mon Sep 17 00:00:00 2001 From: Ada Christine Date: Sun, 24 May 2026 11:09:31 +0000 Subject: rename and move, function renames in stdio --- lib/libc/memmove.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 lib/libc/memmove.c (limited to 'lib/libc/memmove.c') diff --git a/lib/libc/memmove.c b/lib/libc/memmove.c new file mode 100644 index 0000000..fd06bb6 --- /dev/null +++ b/lib/libc/memmove.c @@ -0,0 +1,20 @@ +/* Public domain. */ +#include + +void * +memmove (void *dest, const void *src, size_t len) +{ + char *d = dest; + const char *s = src; + if (d < s) + while (len--) + *d++ = *s++; + else + { + const char *lasts = s + (len-1); + char *lastd = d + (len-1); + while (len--) + *lastd-- = *lasts--; + } + return dest; +} -- cgit v1.3.1-1-g115d