2022-12-22 11:54:17 -05:00
|
|
|
/* ************************************************************************** */
|
|
|
|
/* */
|
|
|
|
/* ::: :::::::: */
|
|
|
|
/* ft_strlen.c :+: :+: :+: */
|
|
|
|
/* +:+ +:+ +:+ */
|
|
|
|
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
|
|
|
|
/* +#+#+#+#+#+ +#+ */
|
|
|
|
/* Created: 2022/09/26 12:03:59 by cchauvet #+# #+# */
|
2023-01-05 13:04:29 -05:00
|
|
|
/* Updated: 2023/01/05 17:46:12 by cchauvet ### ########.fr */
|
2022-12-22 11:54:17 -05:00
|
|
|
/* */
|
|
|
|
/* ************************************************************************** */
|
2023-01-05 13:04:29 -05:00
|
|
|
|
|
|
|
#include "libft.h"
|
2022-12-22 11:54:17 -05:00
|
|
|
|
|
|
|
size_t ft_strlen(const char *s)
|
|
|
|
{
|
|
|
|
size_t length;
|
|
|
|
|
2023-01-05 13:04:29 -05:00
|
|
|
if (s == NULL)
|
|
|
|
return (0);
|
2022-12-22 11:54:17 -05:00
|
|
|
length = 0;
|
|
|
|
while (s[length])
|
|
|
|
length++;
|
|
|
|
return (length);
|
|
|
|
}
|