summaryrefslogtreecommitdiffstats
path: root/libft/src/ft_lstlast.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--libft/src/ft_lstlast.c9
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);
}