aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_lstlast.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ft_lstlast.c')
-rw-r--r--src/ft_lstlast.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/ft_lstlast.c b/src/ft_lstlast.c
new file mode 100644
index 0000000..68b6337
--- /dev/null
+++ b/src/ft_lstlast.c
@@ -0,0 +1,11 @@
+#include "libft.h"
+
+t_list *
+ft_lstlast (t_list *lst)
+{
+ if (!lst)
+ return (NULL);
+ while (lst->next)
+ lst = lst->next;
+ return (lst);
+}