libft
Loading...
Searching...
No Matches
ft_lstadd_back.c
Go to the documentation of this file.
1/* ************************************************************************** */
2/* */
3/* ::: :::::::: */
4/* ft_lstadd_back.c :+: :+: :+: */
5/* +:+ +:+ +:+ */
6/* By: tspoof <tspoof@student.hive.fi> +#+ +:+ +#+ */
7/* +#+#+#+#+#+ +#+ */
8/* Created: 2022/11/07 13:31:28 by tspoof #+# #+# */
9/* Updated: 2023/02/14 14:56:56 by tspoof ### ########.fr */
10/* */
11/* ************************************************************************** */
12
13#include "libft.h"
14
15void ft_lstadd_back(t_list **lst, t_list *node)
16{
17 t_list *tmp;
18
19 if (!lst)
20 return ;
21 if (!(*lst))
22 {
23 *lst = node;
24 return ;
25 }
26 tmp = *lst;
27 while (tmp->next)
28 tmp = tmp->next;
29 tmp->next = node;
30}
void ft_lstadd_back(t_list **lst, t_list *node)
List add back.
Definition libft.h:22
struct s_list * next
Definition libft.h:24