42_solong/libftx/libft/ft_lstlast.c
Camille Chauvet 9e58abcd5c kekw
2022-12-22 17:54:17 +01:00

23 lines
1.0 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstlast.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/09/29 23:55:52 by cchauvet #+# #+# */
/* Updated: 2022/09/30 01:20:18 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
t_list *ft_lstlast(t_list *lst)
{
if (lst == NULL)
return (NULL);
while (lst->next != NULL)
lst = lst->next;
return (lst);
}