From: Jim Meyering Date: Sun, 14 Jul 1996 15:05:40 +0000 (+0000) Subject: Return a value! X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=57d9be58d95409a28adb4b90489b4ad5e06623bf;p=pspp Return a value! --- diff --git a/lib/memmove.c b/lib/memmove.c index d7bdd7cd99..57f1e670bb 100644 --- a/lib/memmove.c +++ b/lib/memmove.c @@ -7,7 +7,7 @@ #include #endif -void +void * memmove (dest, source, length) char *dest; const char *source; @@ -18,7 +18,11 @@ memmove (dest, source, length) 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++; + --dest; + } + return (void *) dest; }