~ubuntu-branches/ubuntu/maverick/texinfo/maverick

« back to all changes in this revision

Viewing changes to lib/memmove.c

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Preining
  • Date: 2005-10-28 15:10:30 UTC
  • mto: (2.1.1 dapper) (3.1.4 hardy)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20051028151030-9nsf2s2k2z3fktjt
Tags: upstream-4.8
ImportĀ upstreamĀ versionĀ 4.8

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
# include <config.h>
8
8
#endif
9
9
 
 
10
#include <stddef.h>
 
11
 
10
12
void *
11
 
memmove (dest, source, length)
12
 
     char *dest;
13
 
     const char *source;
14
 
     unsigned length;
 
13
memmove (void *dest0, void const *source0, size_t length)
15
14
{
16
 
  char *d0 = dest;
 
15
  char *dest = dest0;
 
16
  char const *source = source0;
17
17
  if (source < dest)
18
18
    /* Moving from low mem to hi mem; start at end.  */
19
19
    for (source += length, dest += length; length; --length)
24
24
      for (; length; --length)
25
25
        *dest++ = *source++;
26
26
    }
27
 
  return (void *) d0;
 
27
  return dest0;
28
28
}