Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
28 lines (22 sloc) 579 Bytes
/* 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
bcopy (src, dest, len)
register char *src, *dest;
int len;
if (dest < src)
while (len--)
*dest++ = *src++;
char *lasts = src + (len-1);
char *lastd = dest + (len-1);
while (len--)
*(char *)lastd-- = *(char *)lasts--;
Something went wrong with that request. Please try again.