123456789101112131415161718192021222324 |
- /* ************************************************************************** */
- /* */
- /* ::: :::::::: */
- /* ft_strrchr.c :+: :+: :+: */
- /* +:+ +:+ +:+ */
- /* By: mazimi <mazimi@student.42.fr> +#+ +:+ +#+ */
- /* +#+#+#+#+#+ +#+ */
- /* Created: 2014/11/22 15:42:16 by mazimi #+# #+# */
- /* Updated: 2015/04/16 19:01:12 by mazimi ### ########.fr */
- /* */
- /* ************************************************************************** */
- #include "libft.h"
- char *ft_strrchr(const char *s, int c)
- {
- int i;
- i = ft_strlen(s) + 1;
- while (--i >= -1)
- if (s[i] == c)
- return ((char *)&s[i]);
- return (NULL);
- }
|