-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_lstaddend.c
28 lines (25 loc) · 1.06 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstaddend.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cyildiri <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/10/12 14:46:14 by cyildiri #+# #+# */
/* Updated: 2016/10/12 14:59:30 by cyildiri ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_lstaddend(t_list **alist, t_list *new)
{
t_list *cur;
cur = *alist;
if (cur)
{
while (cur->next)
cur = cur->next;
cur->next = new;
}
else
*alist = new;
}