/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_strrchr.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: cacharle +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/10/07 10:26:24 by cacharle #+# #+# */ /* Updated: 2019/10/07 10:26:46 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ #include #include "libft.h" char *ft_strrchr(const char *s, int c) { size_t i; i = ft_strlen(s); while (s[i] != (char)c) { if (i == 0) return (NULL); i--; } return ((char*)s + i); }