copy on git
This commit is contained in:
commit
42653de246
205 changed files with 7459 additions and 0 deletions
26
libft/ft_lstadd_back_bonus.c
Executable file
26
libft/ft_lstadd_back_bonus.c
Executable file
|
|
@ -0,0 +1,26 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_lstadd_back_bonus.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: thrieg <thrieg@student.42mulhouse.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/10/16 12:41:51 by thrieg #+# #+# */
|
||||
/* Updated: 2025/02/16 19:03:52 by thrieg ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libft.h"
|
||||
|
||||
//returns without doing anything if lst or new is NULL, this is dumb because we
|
||||
//can't report the error given the prototyping but I'm not taking any risk for
|
||||
//my 3th retry...
|
||||
void ft_lstadd_back(t_list **lst, t_list *new)
|
||||
{
|
||||
if (!lst || !new)
|
||||
return ;
|
||||
if (*lst == NULL)
|
||||
*lst = new;
|
||||
else
|
||||
ft_lstlast(*lst)->next = new;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue