freebsd-dev/contrib/binutils/libiberty/bcopy.c
David E. O'Brien dbbf32dd39 Enlist the FreeBSD-CURRENT users as testers of what is to become Binutils
version 2.12.0.  These bits are taken from the FSF anoncvs repo on
27-January-2002 03:41 PST.
2002-01-27 12:00:11 +00:00

28 lines
579 B
C

/* bcopy -- copy memory regions of arbitary length
@deftypefn Supplemental void bcopy (char *@var{in}, char *@var{out}, int @var{length})
Copies @var{length} bytes from memory region @var{in} to region
@var{out}. The use of @code{bcopy} is deprecated in new programs.
@end deftypefn
*/
void
bcopy (src, dest, len)
register char *src, *dest;
int len;
{
if (dest < src)
while (len--)
*dest++ = *src++;
else
{
char *lasts = src + (len-1);
char *lastd = dest + (len-1);
while (len--)
*(char *)lastd-- = *(char *)lasts--;
}
}