summaryrefslogtreecommitdiff
path: root/usr/sdk/common
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-12-21 19:10:19 -0500
committerIan Moffett <ian@osmora.org>2025-12-21 19:10:19 -0500
commit3d2a2a58c11fa6b7653a0f77de9aa1f7cdb1921a (patch)
tree73be80da6920ff5d354e6d620aa09d28d2a88945 /usr/sdk/common
parent085f9b4de880efef92ae5a678c16fa8f05c8a579 (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.c20
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;
+}