X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fmemmove.c;h=ea38e8df549e9e1210c0a38bbe8ed08e45a93603;hb=ecd76948cbe7a787761c9a71739256abb9b85d8c;hp=57f1e670bbd0f414a5bf56ac265c76674b8e60ad;hpb=57d9be58d95409a28adb4b90489b4ad5e06623bf;p=gnulib.git diff --git a/lib/memmove.c b/lib/memmove.c index 57f1e670b..ea38e8df5 100644 --- a/lib/memmove.c +++ b/lib/memmove.c @@ -3,8 +3,8 @@ In the public domain. By David MacKenzie . */ -#ifdef HAVE_CONFIG_H -#include +#if HAVE_CONFIG_H +# include #endif void * @@ -13,6 +13,7 @@ memmove (dest, source, length) const char *source; unsigned length; { + char *d0 = dest; 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 (void *) d0; }