libft/ft_lstadd_back.c

13 lines
186 B
C
Raw Normal View History

2024-10-13 17:10:04 +00:00
#include "libft.h"
void ft_lstadd_back(t_list **alst, t_list *new)
{
2024-10-14 19:55:44 +00:00
if (!alst) {
(*alst) = new;
return;
}
2024-10-13 17:10:04 +00:00
while ((*alst)->next)
alst = &(*alst)->next;
(*alst)->next = new;
}