libft/ft_lstadd_front.c
Raphaël 7bd66aee5b
Push libft
125/100 corrected the 14/11/23
2023-11-14 13:31:56 +01:00

24 lines
1 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstadd_front.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: rparodi <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/11/12 11:40:16 by rparodi #+# #+# */
/* Updated: 2023/11/12 17:14:33 by rparodi ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_lstadd_front(t_list **lst, t_list *new)
{
if (*lst == NULL)
{
*lst = new;
return ;
}
new->next = *lst;
*lst = new;
}