summaryrefslogtreecommitdiffstats
path: root/usr/klibc/strlen.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--usr/klibc/strlen.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/usr/klibc/strlen.c b/usr/klibc/strlen.c
new file mode 100644
index 0000000..86526a5
--- /dev/null
+++ b/usr/klibc/strlen.c
@@ -0,0 +1,13 @@
+/*
+ * strlen()
+ */
+
+#include <string.h>
+
+size_t strlen(const char *s)
+{
+ const char *ss = s;
+ while (*ss)
+ ss++;
+ return ss - s;
+}