X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fmemmove.c;h=79cc7827396c0ffbe75e932f8b9d93a27994b6e1;hb=10cf9b5e371bc4927b2b28354c19b62943dfe95e;hp=57f1e670bbd0f414a5bf56ac265c76674b8e60ad;hpb=57d9be58d95409a28adb4b90489b4ad5e06623bf;p=gnulib.git diff --git a/lib/memmove.c b/lib/memmove.c index 57f1e670b..79cc78273 100644 --- a/lib/memmove.c +++ b/lib/memmove.c @@ -3,16 +3,17 @@ In the public domain. By David MacKenzie . */ -#ifdef HAVE_CONFIG_H -#include +#if HAVE_CONFIG_H +# include #endif +#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 +23,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; }