X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fmemmove.c;h=c5ff8b520df9802d0ada61ee5a940a73e8d35d0c;hb=b156173b313f1903489b8c0c74292de350637f5f;hp=a5bf7660aa7b5a48fcf9825273ee60ada55aa72b;hpb=0111d737beaafaeeb8fa7a99f0ef51b7fc04167b;p=gnulib.git diff --git a/lib/memmove.c b/lib/memmove.c index a5bf7660a..c5ff8b520 100644 --- a/lib/memmove.c +++ b/lib/memmove.c @@ -3,16 +3,15 @@ In the public domain. By David MacKenzie . */ -#ifdef HAVE_CONFIG_H -# include -#endif +#include + +#include void * -memmove (dest, source, length) - char *dest; - const char *source; - unsigned length; +memmove (void *dest0, void const *source0, size_t length) { + char *dest = dest0; + char const *source = source0; if (source < dest) /* Moving from low mem to hi mem; start at end. */ for (source += length, dest += length; length; --length) @@ -22,7 +21,6 @@ memmove (dest, source, length) /* Moving from hi mem to low mem; start at beginning. */ for (; length; --length) *dest++ = *source++; - --dest; } - return (void *) dest; + return dest0; }