-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_lstaddend.c
executable file
·34 lines (30 loc) · 1.14 KB
/
ft_lstaddend.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
28
29
30
31
32
33
34
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstaddend.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ngouy <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2014/11/13 10:23:33 by ngouy #+# #+# */
/* Updated: 2015/11/04 16:06:45 by ngouy ### ########.fr */
/* */
/* ************************************************************************** */
/*
** add new item at the end of the list
*/
#include "libft.h"
void ft_lstaddend(t_list **alst, t_list *new)
{
t_list *tmp;
if (!new)
return ;
if (!*alst)
{
*alst = new;
return ;
}
tmp = *alst;
while (tmp->next)
tmp = tmp->next;
tmp->next = new;
}