Back to index

cell-binutils  2.17cvs20070401
Functions
bcopy.c File Reference
#include <stddef.h>

Go to the source code of this file.

Functions

void bcopy (const void *src, void *dest, size_t len)

Function Documentation

void bcopy ( const void *  src,
void *  dest,
size_t  len 
)

Definition at line 15 of file bcopy.c.

{
  if (dest < src)
    {
      const char *firsts = (const char *) src;
      char *firstd = (char *) dest;
      while (len--)
       *firstd++ = *firsts++;
    }
  else
    {
      const char *lasts = (const char *)src + (len-1);
      char *lastd = (char *)dest + (len-1);
      while (len--)
        *lastd-- = *lasts--;
    }
}