Newer
Older
ubixos / src / lib / libc / string / memcpy.c
@apwillia apwillia on 6 Jul 2002 369 bytes Fixed typos
#include <sys/types.h>
#include <string.h>

void * memcpy(void * dst, const void * src, size_t length)
{
    size_t x = length / 4;
    size_t y = length % 4;
    size_t i;

    for (i = 0; i < x; i++)
	((unsigned long *)dst)[i] = ((unsigned long *)src)[i];

    for (i = 0; i < y; i++)
	((char *) dst)[length-y+i] = ((char *) src)[length-y+i];
    
    return dst;
}