1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-04-19 02:10:57 +02:00
Files
coreutils/lib/memcpy.c

17 lines
336 B
C
Raw Normal View History

1995-07-30 05:30:04 +00:00
/* Copy LEN bytes starting at SRCADDR to DESTADDR. Result undefined
if the source overlaps with the destination.
Return DESTADDR. */
1995-03-12 18:21:38 +00:00
1995-07-30 05:30:04 +00:00
char *
memcpy (destaddr, srcaddr, len)
char *destaddr;
const char *srcaddr;
int len;
1995-03-12 18:21:38 +00:00
{
1995-07-30 05:30:04 +00:00
char *dest = destaddr;
1995-03-12 18:21:38 +00:00
1995-07-30 05:30:04 +00:00
while (len-- > 0)
*destaddr++ = *srcaddr++;
return dest;
1995-03-12 18:21:38 +00:00
}