diff options
author | Rudy Bousset <rbousset@z2r5p2.le-101.fr> | 2020-01-29 19:52:32 +0100 |
---|---|---|
committer | Rudy Bousset <rbousset@z2r5p2.le-101.fr> | 2020-01-29 19:52:32 +0100 |
commit | a8f215adbc079c97589dd3412426f29224f73bd3 (patch) | |
tree | 48ab4726fd888ce13d313f96b81452e7a22c77fd | |
parent | One last check (diff) | |
download | 42-cub3d-a8f215adbc079c97589dd3412426f29224f73bd3.tar.gz 42-cub3d-a8f215adbc079c97589dd3412426f29224f73bd3.tar.bz2 42-cub3d-a8f215adbc079c97589dd3412426f29224f73bd3.tar.xz 42-cub3d-a8f215adbc079c97589dd3412426f29224f73bd3.tar.zst 42-cub3d-a8f215adbc079c97589dd3412426f29224f73bd3.zip |
Perfect
-rw-r--r-- | src/ft_check_map_line.c | 3 | ||||
-rw-r--r-- | src/ft_get_map_redo.c | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/ft_check_map_line.c b/src/ft_check_map_line.c index 1c8c6c6..0d164cd 100644 --- a/src/ft_check_map_line.c +++ b/src/ft_check_map_line.c @@ -43,7 +43,8 @@ ft_check_map_line(char *line, uint8_t l, t_cub *clist) } i++; } - if (line[0] != '1' || line[i - 1] != '1') + if (line[0] != '1' || line[i - 1] != '1' + || ft_get_line_len(line) != clist->map_w) return (-1); return (0); } diff --git a/src/ft_get_map_redo.c b/src/ft_get_map_redo.c index a621282..be6f987 100644 --- a/src/ft_get_map_redo.c +++ b/src/ft_get_map_redo.c @@ -43,12 +43,12 @@ ft_get_map_first_line(char *line, t_cub *clist) ft_memdel(line); return (-1); } + clist->map_w = ft_get_line_len(line); if (ft_check_map_line(line, 1, clist) < 0) { ft_memdel(line); return (-1); } - clist->map_w = ft_get_line_len(line); clist->mapl = NULL; if (ft_cat_mapl(line, 0, clist) < 0) { |