fractol/libft/src/ft_lstadd_back.c

30 lines
1.1 KiB
C
Raw Normal View History

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