42_libft/ft_lstlast.c

23 lines
1.0 KiB
C
Raw Permalink Normal View History

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