mirror of
https://github.com/Ladebeze66/libft.git
synced 2025-12-13 04:36:55 +01:00
30 lines
1.1 KiB
C
Executable File
30 lines
1.1 KiB
C
Executable File
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* ft_lstadd_back.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: fgras-ca <marvin@42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2023/02/23 18:08:00 by fgras-ca #+# #+# */
|
|
/* Updated: 2023/02/23 18:15:14 by fgras-ca ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include "libft.h"
|
|
|
|
void ft_lstadd_back(t_list **lst, t_list *new)
|
|
{
|
|
t_list *temp;
|
|
|
|
if (new && lst)
|
|
{
|
|
if (*lst)
|
|
{
|
|
temp = ft_lstlast(*lst);
|
|
temp->next = new;
|
|
}
|
|
else
|
|
*lst = new;
|
|
}
|
|
}
|