diff --git a/includes/ft_lst.h b/includes/ft_lst.h index 41295e3..593bed1 100644 --- a/includes/ft_lst.h +++ b/includes/ft_lst.h @@ -6,7 +6,7 @@ /* By: myeow +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/03/28 20:38:22 by myeow #+# #+# */ -/* Updated: 2024/03/31 23:26:39 by myeow ### ########.fr */ +/* Updated: 2024/04/04 01:48:22 by myeow ### ########.fr */ /* */ /* ************************************************************************** */ @@ -28,7 +28,7 @@ void ft_lstdelone(t_list *lst, void (*del) (void *)); void ft_lstclear(t_list **lst, void (*del) (void *)); void ft_lstiter(t_list *lst, void (*f) (void *)); t_list *ft_lstmap(t_list *lst, void *(*f) (void *), void (*del) (void *)); -void ft_lstprint(t_list *lst); +void ft_lstprint(t_list *lst, char sep); int ft_lstmin(t_list *lst); int ft_lstmax(t_list *lst); void ft_lstrotate(t_list **lst); diff --git a/srcs/lst_utils/ft_lstprint.c b/srcs/lst_utils/ft_lstprint.c index b776149..985f3ea 100644 --- a/srcs/lst_utils/ft_lstprint.c +++ b/srcs/lst_utils/ft_lstprint.c @@ -6,7 +6,7 @@ /* By: myeow +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/03/29 20:03:02 by myeow #+# #+# */ -/* Updated: 2024/03/30 16:59:01 by myeow ### ########.fr */ +/* Updated: 2024/04/03 17:22:37 by myeow ### ########.fr */ /* */ /* ************************************************************************** */ @@ -14,14 +14,14 @@ #include "../../includes/libft.h" #include "../../includes/ft_error.h" -void ft_lstprint(t_list *lst) +void ft_lstprint(t_list *lst, char sep) { if (!lst) ft_error(NULL_ERROR); while (lst) { ft_putnbr_fd(*((int *) lst->content), 1); - ft_putchar_fd('\n', 1); + ft_putchar_fd(sep, 1); lst = lst->next; } }