-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_lstappend.c
27 lines (24 loc) · 1.08 KB
/
ft_lstappend.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_lstappend.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ademenet <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/06/28 15:51:26 by ademenet #+# #+# */
/* Updated: 2016/06/28 15:54:05 by ademenet ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_lstappend(t_list *list, t_list *new)
{
t_list *cur;
if (list && new)
{
cur = list;
while (cur->next != NULL)
cur = cur->next;
cur->next = new;
new->next = NULL;
}
}