diff options
| author | Ada Christine <adachristine18@gmail.com> | 2021-03-29 01:41:50 +0000 |
|---|---|---|
| committer | Ada Christine <adachristine18@gmail.com> | 2021-03-29 01:41:50 +0000 |
| commit | 42c6af83ec7e26983f1ecdefc81ea481a2354cb4 (patch) | |
| tree | a096824a181eff4874e7840d148f3e5a06e3a5df /lib/memmove.c | |
| parent | 56ec6c782455f7d8e4560d30ad6d2c3e1cd2738f (diff) | |
don't echo command spam
move common files to new source
add VPATH to loader and kernel makefiles for common source
Diffstat (limited to 'lib/memmove.c')
| -rw-r--r-- | lib/memmove.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/memmove.c b/lib/memmove.c new file mode 100644 index 0000000..fd06bb6 --- /dev/null +++ b/lib/memmove.c @@ -0,0 +1,20 @@ +/* Public domain. */ +#include <stddef.h> + +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; +} |
