lstiter reparee fonction sapplique sur content

This commit is contained in:
Hugo LAMY
2019-11-29 16:27:48 +01:00
parent ced3108518
commit aa802f51c9
4 changed files with 24 additions and 17 deletions

View File

@@ -6,7 +6,7 @@
/* By: hulamy <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/11/25 14:14:11 by hulamy #+# #+# */
/* Updated: 2019/11/28 17:20:38 by hulamy ### ########.fr */
/* Updated: 2019/11/29 16:27:05 by hulamy ### ########.fr */
/* */
/* ************************************************************************** */
@@ -75,12 +75,11 @@
void ft_lstiter(t_list *lst, void (*f)(void *))
{
if (lst && f)
if (!f)
return;
while (lst)
{
while (lst)
{
f(lst);
lst = lst->next;
}
f(lst->content);
lst = lst->next;
}
}