From a1ea0b4d5f6b27d9983a7702491b00dbe2bab610 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Fri, 24 Jan 2020 19:26:33 +0100 Subject: Not ignoring get_next_line return value anymore --- src/ft_check_empty_line.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/ft_check_empty_line.c') diff --git a/src/ft_check_empty_line.c b/src/ft_check_empty_line.c index 7f58205..5515c90 100644 --- a/src/ft_check_empty_line.c +++ b/src/ft_check_empty_line.c @@ -6,7 +6,11 @@ ft_check_empty_line(int fd, unsigned int linum, t_win *wlist) { char *line; - get_next_line(fd, &line); + if (get_next_line(fd, &line) <= 0) + { + ft_memdel(line); + ft_map_error(linum, wlist); + } if (*line) { ft_memdel(line); -- cgit v1.2.3