libft strlen

This commit is contained in:
2026-03-29 18:24:06 +02:00
parent 660614738c
commit f18659cbf1
2 changed files with 6 additions and 9 deletions
Executable
BIN
View File
Binary file not shown.
+2 -5
View File
@@ -12,14 +12,11 @@
#include "libft.h"
size_t ft_strlen(char *str, char c)
{
size_t ft_strlen(const char *s) {
size_t i;
i = 0;
if (!str)
return (0);
while (str[i] && str[i] != c)
while (s[i])
i++;
return (i);
}