X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fmemmove.c;h=79cc7827396c0ffbe75e932f8b9d93a27994b6e1;hb=b3b353659ac863c94e9705047710a99fa58fe0b1;hp=d7bdd7cd99503b51ebe37eb7d45d778a8954e8d3;hpb=9b8ea95435bc2ccb0882039535ccd5fac84dc935;p=gnulib.git diff --git a/lib/memmove.c b/lib/memmove.c index d7bdd7cd9..79cc78273 100644 --- a/lib/memmove.c +++ b/lib/memmove.c @@ -3,22 +3,26 @@ In the public domain. By David MacKenzie . */ -#ifdef HAVE_CONFIG_H -#include +#if HAVE_CONFIG_H +# include #endif -void -memmove (dest, source, length) - char *dest; - const char *source; - unsigned length; +#include + +void * +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) *--dest = *--source; else if (source != dest) - /* Moving from hi mem to low mem; start at beginning. */ - for (; length; --length) - *dest++ = *source++; + { + /* Moving from hi mem to low mem; start at beginning. */ + for (; length; --length) + *dest++ = *source++; + } + return dest0; }