diff options
Diffstat (limited to 'src/ft_get_map.c')
-rw-r--r-- | src/ft_get_map.c | 12 |
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); } |