-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathft_lstadd_back.c
More file actions
24 lines (21 loc) · 1.06 KB
/
Copy pathft_lstadd_back.c
File metadata and controls
24 lines (21 loc) · 1.06 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
/* ************************************************************************** */
/* */
/* :::::::: */
/* ft_lstadd_back.c :+: :+: */
/* +:+ */
/* By: ksmorozo <ksmorozo@student.codam.nl> +#+ */
/* +#+ */
/* Created: 2020/11/25 18:16:24 by ksmorozo #+# #+# */
/* Updated: 2021/07/07 12:16:21 by ksmorozo ######## odam.nl */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_lstadd_back(t_list **lst, t_list *new)
{
t_list *last_element;
last_element = ft_lstlast(*lst);
if (!last_element)
*lst = new;
else
last_element->next = new;
}