-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathft_lstadd_back.c
27 lines (24 loc) · 1.1 KB
/
ft_lstadd_back.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_lstadd_back.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mihykim <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/03/01 14:48:46 by mihykim #+# #+# */
/* Updated: 2020/04/03 21:51:01 by mihykim ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
/*
** - Adds the element 'new' at the end of the list
*/
void ft_lstadd_back(t_list **lst, t_list *new)
{
if (lst == 0 || new == 0)
return ;
if (*lst == 0)
*lst = new;
else
(ft_lstlast(*lst))->next = new;
}