29 lines
1.1 KiB
C
29 lines
1.1 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* ft_strrchr.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: jfleury <jfleury@student.42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2018/11/08 14:47:08 by jfleury #+# #+# */
|
|
/* Updated: 2018/11/13 18:28:35 by jfleury ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include "libft.h"
|
|
#include <string.h>
|
|
|
|
char *ft_strrchr(const char *s, int c)
|
|
{
|
|
int i;
|
|
|
|
i = ft_strlen((char *)s);
|
|
while (i >= 0)
|
|
{
|
|
if (s[i] == c)
|
|
return ((char *)s + i);
|
|
i--;
|
|
}
|
|
return (NULL);
|
|
}
|