From 9a915b797a80c2a776027b1fcc37f1e7b8ab1b24 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Tue, 29 Sep 2020 19:50:20 +0200 Subject: Update --- libft/src/ft_strrchr.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'libft/src/ft_strrchr.c') diff --git a/libft/src/ft_strrchr.c b/libft/src/ft_strrchr.c index 1ebbdc3..d9a5466 100644 --- a/libft/src/ft_strrchr.c +++ b/libft/src/ft_strrchr.c @@ -13,15 +13,14 @@ #include #include -char - *ft_strrchr(const char *s, int c) +char *ft_strrchr(const char *s, int c) { size_t i; i = ft_strlen(s); while (s[i] != c) { - if (!i) + if (i == 0) return (NULL); i--; } -- cgit v1.2.3