From d78b61e3efaea197a6e5b2b72bf2981a9ed69461 Mon Sep 17 00:00:00 2001 From: Rob Funk Date: Tue, 8 Jun 2004 03:59:01 +0000 Subject: Add files from ESR's dev directory that weren't under version control svn path=/trunk/; revision=3881 --- memmove.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 memmove.c (limited to 'memmove.c') diff --git a/memmove.c b/memmove.c new file mode 100644 index 00000000..2ffab60c --- /dev/null +++ b/memmove.c @@ -0,0 +1,22 @@ +/* + * Scratch implementation of memmove() in case your C library lacks one. + * + * For license terms, see the file COPYING in this directory. + */ +char *memmove(char *dst, register char *src, register int n) +{ + register char *svdst; + + if ((dst > src) && (dst < src + n)) + { + src += n; + for (svdst = dst + n; n-- > 0; ) + *--svdst = *--src; + } + else + { + for (svdst = dst; n-- > 0; ) + *svdst++ = *src++; + } + return dst; +} -- cgit v1.2.3