-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_lstadd_back.c
24 lines (21 loc) · 1.05 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstadd_back.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: rbetz <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/04/11 15:01:51 by rbetz #+# #+# */
/* Updated: 2022/04/13 14:14:11 by rbetz ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_lstadd_back(t_list **lst, t_list *new_node)
{
t_list *tmp;
tmp = ft_lstlast(*lst);
if (tmp == NULL)
*lst = new_node;
else
tmp->next = new_node;
}