42-archive/42sh/libft/src/str/ft_strlen.c

25 lines
1,022 B
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strlen.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/11/03 14:58:22 by jhalford #+# #+# */
/* Updated: 2017/03/18 14:25:09 by gwojda ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
size_t ft_strlen(const char *s)
{
int i;
i = 0;
if (!s)
return (0);
while (s[i])
i++;
return (i);
}