File: memcpy.c

package info (click to toggle)
gsl 2.3%2Bdfsg-1
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 20,392 kB
  • ctags: 15,188
  • sloc: ansic: 235,014; sh: 11,541; makefile: 869
file content (20 lines) | stat: -rw-r--r-- 424 bytes parent folder | download | duplicates (14)
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

void *
memcpy (destaddr, srcaddr, len)
     void *destaddr;
     const void *srcaddr;
     unsigned int len;
{
  char *dest = (char *) destaddr;
  const char *src = srcaddr;
  while (len-- > 0)
    *dest++ = *src++;
  return destaddr;
}