fractol/libft/src/ft_lstadd_back.c
2023-03-07 05:31:00 +01:00

30 lines
1.1 KiB
C

/* ************************************************************************** */
/* */
/* :::::::: */
/* ft_lstadd_back.c |o_o || | */
/* +:+ */
/* By: djonker <marvin@codam.nl> +#+ */
/* +#+ */
/* Created: 2020/11/13 18:48:54 by djonker #+# #+# */
/* Updated: 2023/03/03 19:09:28 by houtworm \___)=(___/ */
/* */
/* ************************************************************************** */
#include "../libft.h"
void ft_lstadd_back(t_list **lst, t_list *new)
{
t_list *l;
if (lst && new)
{
if (*lst)
{
l = ft_lstlast(*lst);
l->next = new;
}
else
*lst = new;
}
}