OrionLibC
Barry Importing existing Orion LibC 03048a9 (2 years, 2 months ago)diff --git a/string/strlen.c b/string/strlen.c new file mode 100644 index 0000000..a8d506c --- /dev/null +++ b/string/strlen.c @@ -0,0 +1,12 @@ +#include <string.h> + +/* Find length of string */ +size_t +strlen(const char *str) +{ + if (!str) + return 0; + size_t i; + for (i = 0; str[i]; i++); + return i; +}