From 60c1d821860eddf0d8986c0d4e147e76db41fa93 Mon Sep 17 00:00:00 2001 From: Jack Halford Date: Fri, 17 Feb 2017 14:10:23 +0100 Subject: [PATCH] gnl fixes --- libft/src/get_next_line/get_next_line.c | 9 +++++---- libft/src/lst/ft_lst_delif.c | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/libft/src/get_next_line/get_next_line.c b/libft/src/get_next_line/get_next_line.c index b66db533..3dabaaf6 100644 --- a/libft/src/get_next_line/get_next_line.c +++ b/libft/src/get_next_line/get_next_line.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/11/15 13:12:06 by jhalford #+# #+# */ -/* Updated: 2017/02/17 14:03:38 by jhalford ### ########.fr */ +/* Updated: 2017/02/17 14:09:58 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ @@ -17,9 +17,10 @@ static int ft_fdcmp(t_save *a, int *b) return (a->fd - *b); } -static int ft_gnlfree(t_save *a, size_t size) +static void ft_gnlfree(void *a, size_t size) { - ft_strdel(&a->str); + (void)size; + ft_strdel(&((t_save*)a)->str); } static t_list *ft_newfd(t_list **head, int fd) @@ -82,6 +83,6 @@ int get_next_line(int const fd, char **line) return (1); } if (!(ret = ft_loop_read(fd, line, save))) - ft_lst_delif(&head, &fd, ft_fdcmp, ft_gnlfree); + ft_lst_delif(&head, (int *)&fd, ft_fdcmp, &ft_gnlfree); return (ret); } diff --git a/libft/src/lst/ft_lst_delif.c b/libft/src/lst/ft_lst_delif.c index 7c195b35..6e0391f8 100644 --- a/libft/src/lst/ft_lst_delif.c +++ b/libft/src/lst/ft_lst_delif.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/11/04 11:09:12 by jhalford #+# #+# */ -/* Updated: 2017/02/17 13:59:22 by jhalford ### ########.fr */ +/* Updated: 2017/02/17 14:07:04 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */