-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_lst_push_back.c
27 lines (24 loc) · 1.08 KB
/
ft_lst_push_back.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lst_push_back.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: imarakho <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/12/08 14:40:17 by imarakho #+# #+# */
/* Updated: 2016/12/11 16:20:08 by imarakho ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_lst_push_back(t_list **alst, t_list *first)
{
t_list *tmp;
while (*alst)
{
tmp = *alst;
if (*alst->next == NULL)
ft_lstadd(**alst, *new);
*alst = tmp->next;
}
*alst = NULL;
}