9 lines
241 B
C
9 lines
241 B
C
|
#include <string.h>
|
||
|
#include <errno.h>
|
||
|
|
||
|
int memcpy_s(void *dest, size_t dest_size, const void *src, size_t count) {
|
||
|
if (!dest || !src) return EINVAL;
|
||
|
if (count > dest_size) return ERANGE;
|
||
|
memcpy(dest, src, count);
|
||
|
return 0;
|
||
|
}
|