summaryrefslogtreecommitdiff
path: root/lib/memcpy.c
blob: d36cef20c56731fabc5a73e6fdad19838d96e8d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* Copy LEN bytes starting at SRCADDR to DESTADDR.  Result undefined
   if the source overlaps with the destination.
   Return DESTADDR. */

#if HAVE_CONFIG_H
# include <config.h>
#endif

char *
memcpy (destaddr, srcaddr, len)
     char *destaddr;
     const char *srcaddr;
     int len;
{
  char *dest = destaddr;

  while (len-- > 0)
    *destaddr++ = *srcaddr++;
  return dest;
}