This repository has been archived on 2024-06-25. You can view files and clone it, but cannot push or open issues or pull requests.
rockOS/libc/string/memcpy.c

11 lines
305 B
C
Raw Normal View History

2022-07-18 09:59:04 +03:00
#include <string.h>
void* memcpy(void* restrict dstptr, const void* restrict srcptr, size_t size) {
unsigned char* dst = (unsigned char*) dstptr;
const unsigned char* src = (const unsigned char*) srcptr;
for (size_t i = 0; i < size; i++) {
dst[i] = src[i];
}
return dstptr;
}