-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_lstadd_back.c
More file actions
29 lines (27 loc) · 1.09 KB
/
ft_lstadd_back.c
File metadata and controls
29 lines (27 loc) · 1.09 KB
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstadd_back.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: fraqioui <fraqioui@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/10/12 11:42:07 by fraqioui #+# #+# */
/* Updated: 2022/10/18 17:20:44 by fraqioui ### ########.fr */
/* */
/* ************************************************************************** */
#include"libft.h"
void ft_lstadd_back(t_list **lst, t_list *new)
{
t_list *back;
if (!lst || !new)
return ;
back = *lst;
if (back)
{
while (back->next)
back = back->next;
back->next = new;
}
else
*lst = new;
}