diff options
Diffstat (limited to 'usr/klibc/strlen.c')
-rw-r--r-- | usr/klibc/strlen.c | 13 |
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; +} |