Fix splay tree KEY leak detected in GDB test gdb.base/macscp.exp
[deliverable/binutils-gdb.git] / libiberty / bcopy.c
... / ...
CommitLineData
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
12#include <stddef.h>
13
14void
15bcopy (const void *src, void *dest, size_t len)
16{
17 if (dest < src)
18 {
19 const char *firsts = (const char *) src;
20 char *firstd = (char *) dest;
21 while (len--)
22 *firstd++ = *firsts++;
23 }
24 else
25 {
26 const char *lasts = (const char *)src + (len-1);
27 char *lastd = (char *)dest + (len-1);
28 while (len--)
29 *lastd-- = *lasts--;
30 }
31}
This page took 0.022775 seconds and 4 git commands to generate.