diff options
Diffstat (limited to 'libft/src/ft_lstlast.c')
-rw-r--r-- | libft/src/ft_lstlast.c | 9 |
1 files changed, 6 insertions, 3 deletions
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); } |