X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2Fstring%2Fstrlen.c;h=ec0c21e7134a8c96edbac8b28d353c2592b1abdf;hb=96c55f60f49ceb842cf30e0018bb963ef9ed7d1c;hp=62ab7a147cee519f17d70f5e3cbc3ee0f9f3f958;hpb=dcc8a8e99f69e090a03b7b868443addbc0817820;p=pdclib.old diff --git a/functions/string/strlen.c b/functions/string/strlen.c index 62ab7a1..ec0c21e 100644 --- a/functions/string/strlen.c +++ b/functions/string/strlen.c @@ -5,4 +5,14 @@ // This code is Public Domain. Use, modify, and redistribute at will. // ---------------------------------------------------------------------------- -size_t strlen( const char * s ) { /* TODO */ }; +#include <__size_t.h> + +size_t strlen( const char * src ) +{ + size_t len = 0; + while ( src[len] != '\0' ) + { + ++len; + } + return len; +}