From 462e664d0fdfbe2e9eae5c7e093c5a23b202dae8 Mon Sep 17 00:00:00 2001 From: JozanLeClerc <bousset.rudy@gmail.com> Date: Tue, 29 Sep 2020 19:11:10 +0200 Subject: Norm update --- libft/src/ft_lstlast.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'libft/src/ft_lstlast.c') diff --git a/libft/src/ft_lstlast.c b/libft/src/ft_lstlast.c index 85a708b..cf86397 100644 --- a/libft/src/ft_lstlast.c +++ b/libft/src/ft_lstlast.c @@ -13,12 +13,15 @@ #include <libft.h> #include <stddef.h> -t_list - *ft_lstlast(t_list *lst) +t_list *ft_lstlast(t_list *lst) { - if (!lst) + if (lst == NULL) + { return (NULL); + } while (lst->next != NULL) + { lst = lst->next; + } return (lst); } -- cgit v1.2.3