mirror of
https://github.com/LucasCodeur/alcu.git
synced 2026-04-28 17:44:34 +02:00
libft strlen
This commit is contained in:
+6
-9
@@ -12,14 +12,11 @@
|
|||||||
|
|
||||||
#include "libft.h"
|
#include "libft.h"
|
||||||
|
|
||||||
size_t ft_strlen(char *str, char c)
|
size_t ft_strlen(const char *s) {
|
||||||
{
|
size_t i;
|
||||||
size_t i;
|
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
if (!str)
|
while (s[i])
|
||||||
return (0);
|
i++;
|
||||||
while (str[i] && str[i] != c)
|
return (i);
|
||||||
i++;
|
|
||||||
return (i);
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user