aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_get_map.c
diff options
context:
space:
mode:
authorRudy Bousset <rbousset@z2r4p3.le-101.fr>2020-02-05 14:12:03 +0100
committerRudy Bousset <rbousset@z2r4p3.le-101.fr>2020-02-05 14:12:03 +0100
commite6bbc5e1a7d1b88a5ed241283ec19fbaa672dc33 (patch)
tree7b5e2219785805cefc80bd209c892df42679c303 /src/ft_get_map.c
parentBetter code (diff)
download42-cub3d-e6bbc5e1a7d1b88a5ed241283ec19fbaa672dc33.tar.gz
42-cub3d-e6bbc5e1a7d1b88a5ed241283ec19fbaa672dc33.tar.bz2
42-cub3d-e6bbc5e1a7d1b88a5ed241283ec19fbaa672dc33.tar.xz
42-cub3d-e6bbc5e1a7d1b88a5ed241283ec19fbaa672dc33.tar.zst
42-cub3d-e6bbc5e1a7d1b88a5ed241283ec19fbaa672dc33.zip
Bug fix
Diffstat (limited to '')
-rw-r--r--src/ft_get_map.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/ft_get_map.c b/src/ft_get_map.c
index c5ab0d7..720f412 100644
--- a/src/ft_get_map.c
+++ b/src/ft_get_map.c
@@ -16,6 +16,17 @@
#include <stddef.h>
#include <stdint.h>
+static size_t
+ ft_get_map_h(char **map)
+{
+ size_t i;
+
+ i = 0;
+ while (map[i])
+ i++;
+ return (i);
+}
+
static void
ft_linecpy(char *line, char *mapl, size_t start)
{
@@ -98,6 +109,7 @@ int
clist->mapl[((clist->map_w + 1) * i) - 1] = '\0';
ft_free_words(clist->map);
clist->map = ft_split(clist->mapl, '\n');
+ clist->map_h = ft_get_map_h(clist->map);
ft_memdel((void**)&clist->mapl);
return (0);
}