summaryrefslogtreecommitdiff
path: root/usr/sdk/common/string
diff options
context:
space:
mode:
Diffstat (limited to 'usr/sdk/common/string')
-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;
+}