diff options
| author | Ian Moffett <ian@osmora.org> | 2025-12-21 19:10:19 -0500 |
|---|---|---|
| committer | Ian Moffett <ian@osmora.org> | 2025-12-21 19:10:19 -0500 |
| commit | 3d2a2a58c11fa6b7653a0f77de9aa1f7cdb1921a (patch) | |
| tree | 73be80da6920ff5d354e6d620aa09d28d2a88945 /usr/sdk/common | |
| parent | 085f9b4de880efef92ae5a678c16fa8f05c8a579 (diff) | |
usr: sdk: Add memcpy() function
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'usr/sdk/common')
| -rw-r--r-- | usr/sdk/common/string/memcpy.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/usr/sdk/common/string/memcpy.c b/usr/sdk/common/string/memcpy.c new file mode 100644 index 0000000..5470f5d --- /dev/null +++ b/usr/sdk/common/string/memcpy.c @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2025, Ian Moffett. + * Provided under the BSD-3 clause. + */ + +#include <sdk/string.h> + +void * +memcpy(void *dest, const void *src, USIZE count) +{ + if (dest == NULL || src == NULL) { + return NULL; + } + + for (USIZE i = 0; i < count; ++i) { + ((char *)dest)[i] = ((char *)src)[i]; + } + + return dest; +} |
