X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fmemmove.c;h=0f040540c0dbfe050ce5305a8aba4d3a9bf1bb4f;hb=9ada6e7b5cf3aa507b6b54e47775c29ffd1378d3;hp=d7bdd7cd99503b51ebe37eb7d45d778a8954e8d3;hpb=9b8ea95435bc2ccb0882039535ccd5fac84dc935;p=gnulib.git diff --git a/lib/memmove.c b/lib/memmove.c index d7bdd7cd9..0f040540c 100644 --- a/lib/memmove.c +++ b/lib/memmove.c @@ -3,22 +3,24 @@ In the public domain. By David MacKenzie . */ -#ifdef 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; }