X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fmemmove.c;h=ea38e8df549e9e1210c0a38bbe8ed08e45a93603;hb=98cf1a06469c02df32ea978fe6c6514f1c87f2bc;hp=a5bf7660aa7b5a48fcf9825273ee60ada55aa72b;hpb=0111d737beaafaeeb8fa7a99f0ef51b7fc04167b;p=gnulib.git diff --git a/lib/memmove.c b/lib/memmove.c index a5bf7660a..ea38e8df5 100644 --- a/lib/memmove.c +++ b/lib/memmove.c @@ -3,7 +3,7 @@ In the public domain. By David MacKenzie . */ -#ifdef HAVE_CONFIG_H +#if HAVE_CONFIG_H # include #endif @@ -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; }