24 lines
1 KiB
C
24 lines
1 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* ft_lstadd_back.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2023/10/04 16:24:03 by mcolonna #+# #+# */
|
|
/* Updated: 2023/10/05 12:56:42 by mcolonna ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include "libft.h"
|
|
|
|
void ft_lstadd_back(t_list **lst, t_list *new)
|
|
{
|
|
t_list *last;
|
|
|
|
last = ft_lstlast(*lst);
|
|
if (last)
|
|
last->next = new;
|
|
else
|
|
*lst = new;
|
|
}
|