28 lines
1.0 KiB
C
28 lines
1.0 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* ft_lstlast.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: mdenys <mdenys@student.42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2020/11/04 18:07:26 by mdenys #+# #+# */
|
|
/* Updated: 2020/11/04 18:14:43 by mdenys ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include "libft.h"
|
|
|
|
t_list *ft_lstlast(t_list *lst)
|
|
{
|
|
t_list *new;
|
|
|
|
new = lst;
|
|
if (lst)
|
|
{
|
|
while (new->next != NULL)
|
|
new = new->next;
|
|
return (new);
|
|
}
|
|
return (NULL);
|
|
}
|