From 0e55e163397f2b109321ad284d298e60ee3b97a7 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Fri, 24 Jan 2020 18:52:32 +0100 Subject: cleaner frees --- src/ft_check_empty_line.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/ft_check_empty_line.c (limited to 'src/ft_check_empty_line.c') diff --git a/src/ft_check_empty_line.c b/src/ft_check_empty_line.c new file mode 100644 index 0000000..7f58205 --- /dev/null +++ b/src/ft_check_empty_line.c @@ -0,0 +1,16 @@ +#include +#include + +void +ft_check_empty_line(int fd, unsigned int linum, t_win *wlist) +{ + char *line; + + get_next_line(fd, &line); + if (*line) + { + ft_memdel(line); + ft_map_error(linum, wlist); + } + ft_memdel(line); +} -- cgit v1.2.3