/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_strrchr.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: bchanot +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2015/11/25 13:54:03 by bchanot #+# #+# */ /* Updated: 2015/11/27 03:41:08 by bchanot ### ########.fr */ /* */ /* ************************************************************************** */ #include "libft.h" char *ft_strrchr(const char *s, int c) { int len; len = ft_strlen(s); while (s[len] != (char)c && len >= 0) len--; if (s[len] == (char)c) return ((char *)&s[len]); return (NULL); }