30 lines
1.1 KiB
C
30 lines
1.1 KiB
C
|
/* ************************************************************************** */
|
||
|
/* */
|
||
|
/* :::::::: */
|
||
|
/* ft_lstadd_back.c :+: :+: :+: */
|
||
|
/* +:+ */
|
||
|
/* By: djonker <marvin@codam.nl> +#+ */
|
||
|
/* +#+ */
|
||
|
/* Created: 2020/11/13 18:48:54 by djonker #+# #+# */
|
||
|
/* Updated: 2023/02/07 00:40:30 by houtworm ### ########.fr */
|
||
|
/* */
|
||
|
/* ************************************************************************** */
|
||
|
|
||
|
#include "../libft.h"
|
||
|
|
||
|
void ft_lstadd_back(t_list **lst, t_list *new)
|
||
|
{
|
||
|
t_list *l;
|
||
|
|
||
|
if (lst)
|
||
|
{
|
||
|
if (*lst)
|
||
|
{
|
||
|
l = ft_lstlast(*lst);
|
||
|
l->next = new;
|
||
|
}
|
||
|
else
|
||
|
*lst = new;
|
||
|
}
|
||
|
}
|