diff options
-rw-r--r-- | kernel/string.c | 9 | ||||
-rw-r--r-- | kernel/string.h | 9 |
2 files changed, 18 insertions, 0 deletions
diff --git a/kernel/string.c b/kernel/string.c new file mode 100644 index 0000000..d038c27 --- /dev/null +++ b/kernel/string.c @@ -0,0 +1,9 @@ +#include "string.h" + +size_t strlen(const char *str) +{ + size_t len = 0; + while(str[len]) + len++; + return len; +} diff --git a/kernel/string.h b/kernel/string.h new file mode 100644 index 0000000..dc760a5 --- /dev/null +++ b/kernel/string.h @@ -0,0 +1,9 @@ +#ifndef KERNEL_STRING +#define KERNEL_STRING + +#include <stddef.h> +#include <stdint.h> + +size_t strlen(const char *str); + +#endif /* KERNEL_STRING */ |