source: branches/libc-0.6/src/binutils/libiberty/bcopy.c

Last change on this file was 610, checked in by bird, 22 years ago

This commit was generated by cvs2svn to compensate for changes in r609,
which included commits to RCS files with non-trunk default branches.

  • Property cvs2svn:cvs-rev set to 1.1.1.2
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 579 bytes
Line 
1/* bcopy -- copy memory regions of arbitary length
2
3@deftypefn Supplemental void bcopy (char *@var{in}, char *@var{out}, int @var{length})
4
5Copies @var{length} bytes from memory region @var{in} to region
6@var{out}. The use of @code{bcopy} is deprecated in new programs.
7
8@end deftypefn
9
10*/
11
12void
13bcopy (src, dest, len)
14 register char *src, *dest;
15 int len;
16{
17 if (dest < src)
18 while (len--)
19 *dest++ = *src++;
20 else
21 {
22 char *lasts = src + (len-1);
23 char *lastd = dest + (len-1);
24 while (len--)
25 *(char *)lastd-- = *(char *)lasts--;
26 }
27}
Note: See TracBrowser for help on using the repository browser.