blob: df363a227ea1fa2699c078b67ad769ac7ff58140 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strrchr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: kdx <kdx @student.42angouleme.fr +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/09/27 23:37:56 by kdx #+# #+# */
/* Updated: 2022/10/14 02:37:31 by kdx ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_strrchr(const char *s, int c)
{
size_t i;
i = ft_strlen(s) + 1;
while (i > 0)
{
i -= 1;
if (s[i] == c)
return ((char *)(s + i));
}
return (NULL);
}
|