aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_get_map.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-01-26 22:28:11 +0100
committerJozanLeClerc <bousset.rudy@gmail.com>2020-01-26 22:28:11 +0100
commit29b45c0bbdcc3a8eb980d6fdc65efa09382c0ede (patch)
treea6060e809807384d96099df120d0c423d1da09b1 /src/ft_get_map.c
parentBetter error management (diff)
download42-cub3d-29b45c0bbdcc3a8eb980d6fdc65efa09382c0ede.tar.gz
42-cub3d-29b45c0bbdcc3a8eb980d6fdc65efa09382c0ede.tar.bz2
42-cub3d-29b45c0bbdcc3a8eb980d6fdc65efa09382c0ede.tar.xz
42-cub3d-29b45c0bbdcc3a8eb980d6fdc65efa09382c0ede.tar.zst
42-cub3d-29b45c0bbdcc3a8eb980d6fdc65efa09382c0ede.zip
Can't believe it
Diffstat (limited to 'src/ft_get_map.c')
-rw-r--r--src/ft_get_map.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/ft_get_map.c b/src/ft_get_map.c
new file mode 100644
index 0000000..a45052c
--- /dev/null
+++ b/src/ft_get_map.c
@@ -0,0 +1,20 @@
+#include <libft.h>
+#include <cub3d.h>
+#include <stddef.h>
+#include <stdlib.h>
+
+int
+ft_get_map(int fd, t_win *wlist)
+{
+ size_t i;
+ char *line;
+
+ ft_free_words(wlist->clist->map, NULL);
+ i = 0;
+ if (!(wlist->clist->map = (char**)malloc(40 * sizeof(char*))))
+ return (-1);
+ while (get_next_line(fd, &line) > 0)
+ {
+ }
+ return (0);
+}