(getloadavg): Use `true', not `1'.
[coreutils.git] / lib / bcopy.c
blob50a09f876447f0ac7dd483f626cb62990cdc091b
1 /* bcopy.c -- copy memory.
2 Copy LENGTH bytes from SOURCE to DEST. Does not null-terminate.
3 In the public domain.
4 By David MacKenzie <djm@gnu.ai.mit.edu>. */
6 #include <stddef.h>
8 void
9 bcopy (void const *source0, void *dest0, size_t length)
11 char const *source = source0;
12 char *dest = dest0;
13 if (source < dest)
14 /* Moving from low mem to hi mem; start at end. */
15 for (source += length, dest += length; length; --length)
16 *--dest = *--source;
17 else if (source != dest)
18 /* Moving from hi mem to low mem; start at beginning. */
19 for (; length; --length)
20 *dest++ = *source++;