summaryrefslogtreecommitdiff
path: root/usr/sdk/common
diff options
context:
space:
mode:
Diffstat (limited to 'usr/sdk/common')
-rw-r--r--usr/sdk/common/string/strlen.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/usr/sdk/common/string/strlen.c b/usr/sdk/common/string/strlen.c
new file mode 100644
index 0000000..4499512
--- /dev/null
+++ b/usr/sdk/common/string/strlen.c
@@ -0,0 +1,20 @@
+/*
+ * Copyright (c) 2025, Ian Moffett.
+ * Provided under the BSD-3 clause.
+ */
+
+#include <sdk/string.h>
+#include <sdk/types.h>
+
+USIZE
+strlen(const char *str)
+{
+ USIZE len = 0;
+
+ if (str == NULL) {
+ return 0;
+ }
+
+ while (str[len++] != '\0');
+ return len - 1;
+}