-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_lstpop.c
24 lines (22 loc) · 1.05 KB
/
ft_lstpop.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstpop.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: nle-roux <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/11/28 11:54:01 by nle-roux #+# #+# */
/* Updated: 2023/11/28 14:36:58 by nle-roux ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
t_list *ft_lstpop(t_list **lst)
{
t_list *popped;
if (!lst)
return (NULL);
popped = *lst;
*lst = (*lst)->next;
popped->next = NULL;
return (popped);
}