git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
course 5 and some old slides
[lunaix-os.git]
/
lunaix-os
/
libs
/
libc
/
string
/
strlen.c
diff --git a/lunaix-os/libs/libc/string/strlen.c
b/lunaix-os/libs/libc/string/strlen.c
new file mode 100644
(file)
index 0000000..
8b26def
--- /dev/null
+++ b/
lunaix-os/libs/libc/string/strlen.c
@@ -0,0
+1,10
@@
+#include <libc/string.h>
+
+size_t
+strlen(const char* str)
+{
+ size_t len = 0;
+ while (str[len])
+ len++;
+ return len;
+}
\ No newline at end of file