minishell
ft_lstadd_back.c
Go to the documentation of this file.
1 /* ************************************************************************** */
2 /* */
3 /* ::: :::::::: */
4 /* ft_lstadd_back.c :+: :+: :+: */
5 /* +:+ +:+ +:+ */
6 /* By: kfujita <kfujita@student.42tokyo.jp> +#+ +:+ +#+ */
7 /* +#+#+#+#+#+ +#+ */
8 /* Created: 2022/04/20 00:45:11 by kfujita #+# #+# */
9 /* Updated: 2022/04/25 22:57:08 by kfujita ### ########.fr */
10 /* */
11 /* ************************************************************************** */
12 
13 #include <stddef.h>
14 #include "ft_lst.h"
15 
16 void ft_lstadd_back(t_list **lst, t_list *new)
17 {
18  if (lst == NULL || new == NULL)
19  return ;
20  if (*lst == NULL)
21  *lst = new;
22  else
23  ft_lstlast(*lst)->next = new;
24 }
t_list * ft_lstlast(t_list *lst)
Definition: ft_lstlast.c:16
void ft_lstadd_back(t_list **lst, t_list *new)
Definition: ft_lst.h:18
struct s_list * next
Definition: ft_lst.h:20