aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_check_empty_line.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-01-24 18:52:32 +0100
committerJozanLeClerc <bousset.rudy@gmail.com>2020-01-24 18:52:32 +0100
commit0e55e163397f2b109321ad284d298e60ee3b97a7 (patch)
treef30aacccaefc5c063a2a6840f02d2e02bdef6b90 /src/ft_check_empty_line.c
parentCorrect (diff)
download42-cub3d-0e55e163397f2b109321ad284d298e60ee3b97a7.tar.gz
42-cub3d-0e55e163397f2b109321ad284d298e60ee3b97a7.tar.bz2
42-cub3d-0e55e163397f2b109321ad284d298e60ee3b97a7.tar.xz
42-cub3d-0e55e163397f2b109321ad284d298e60ee3b97a7.tar.zst
42-cub3d-0e55e163397f2b109321ad284d298e60ee3b97a7.zip
cleaner frees
Diffstat (limited to 'src/ft_check_empty_line.c')
-rw-r--r--src/ft_check_empty_line.c16
1 files changed, 16 insertions, 0 deletions
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 <libft.h>
+#include <cub3d.h>
+
+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);
+}