-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_lstpushback.c
28 lines (25 loc) · 1.09 KB
/
ft_lstpushback.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstpushback.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mfebvay <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2015/01/30 19:53:16 by mfebvay #+# #+# */
/* Updated: 2015/02/02 19:22:54 by mfebvay ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_lstpushback(t_list **alst, t_list *new)
{
t_list *current;
current = *alst;
if (current)
{
while (current->next)
current = current->next;
current->next = new;
}
else
*alst = new;
}