/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_lstiter_bonus.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: thrieg +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/10/16 13:11:26 by thrieg #+# #+# */ /* Updated: 2025/02/16 19:03:57 by thrieg ### ########.fr */ /* */ /* ************************************************************************** */ #include "libft.h" //returns without doing anything if lst or f are 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_lstiter(t_list *lst, void (*f)(void *)) { if (!lst || !f) return ; while (lst->next) { f(lst->content); lst = lst->next; } f(lst->content); }