42_minitalk/libftx/libft/ft_lstlast.c

23 lines
1.0 KiB
C
Raw Normal View History

2023-01-23 07:22:30 -05:00
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* 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);
}