31 lines
1.1 KiB
C
31 lines
1.1 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* ft_lstadd_back.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: vvobis <marvin@42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2024/04/09 13:51:32 by vvobis #+# #+# */
|
|
/* Updated: 2024/04/09 18:17:12 by vvobis ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include "libft.h"
|
|
|
|
void ft_lstadd_back(t_list **lst, t_list *new)
|
|
{
|
|
t_list *tmp;
|
|
|
|
if (!new)
|
|
return ;
|
|
if (*lst)
|
|
{
|
|
tmp = *lst;
|
|
while (tmp->next)
|
|
tmp = tmp->next;
|
|
tmp->next = new;
|
|
}
|
|
else
|
|
*lst = new;
|
|
}
|