diff options
Diffstat (limited to 'missing/memmove.c')
-rw-r--r-- | missing/memmove.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/missing/memmove.c b/missing/memmove.c new file mode 100644 index 0000000000..09e64702b6 --- /dev/null +++ b/missing/memmove.c @@ -0,0 +1,24 @@ +/* + * memmove --- move memories. + * + * We supply this routine for those systems that aren't standard yet. + */ + +char * +memmove (dst, src, n) + char *dst, *src; + int n; +{ + char *ret = dst; + + if (src < dst) { + src += n; + dst += n; + while (n--) + *--dst = *--src; + } + else if (dst < src) + while (n--) + *dst++ = *src++; + return ret; +} |