-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_lstapp.c
31 lines (28 loc) · 1.11 KB
/
ft_lstapp.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstapp.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: rmc-coma <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2015/12/03 13:43:46 by rmc-coma #+# #+# */
/* Updated: 2015/12/03 14:14:33 by rmc-coma ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_lstapp(t_list **alst, t_list *new)
{
t_list *lst;
if (*alst != NULL)
{
lst = *alst;
while ((*alst)->next != NULL)
*alst = (*alst)->next;
(*alst)->next = new;
*alst = lst;
}
else
{
*alst = new;
}
}