diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-03-09 14:55:40 +0100 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-03-09 14:55:40 +0100 |
commit | 5ebc5e873770d4862f68993a98d75d09a03cdce4 (patch) | |
tree | 575ca57af546f0818182972332aaa97cb6c5cddf /src/ft_parse_map.c | |
parent | CC back to clang only (diff) | |
download | 42-cub3d-5ebc5e873770d4862f68993a98d75d09a03cdce4.tar.gz 42-cub3d-5ebc5e873770d4862f68993a98d75d09a03cdce4.tar.bz2 42-cub3d-5ebc5e873770d4862f68993a98d75d09a03cdce4.tar.xz 42-cub3d-5ebc5e873770d4862f68993a98d75d09a03cdce4.tar.zst 42-cub3d-5ebc5e873770d4862f68993a98d75d09a03cdce4.zip |
Good parse
Diffstat (limited to 'src/ft_parse_map.c')
-rw-r--r-- | src/ft_parse_map.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/ft_parse_map.c b/src/ft_parse_map.c index 9c688fe..a93cca3 100644 --- a/src/ft_parse_map.c +++ b/src/ft_parse_map.c @@ -64,12 +64,14 @@ static int8_t return (ft_parse_it(fd, clist)); } if (ft_ischarset("1 ", line[0])) - return ((ft_get_map_first_line(line, clist) < 0) ? (-1) : (12)); + return ((ft_get_map_first_line(line, clist) < 0) ? + (-1) : (FT_PARSE_END_RET)); if (!ft_ischarset(FT_CHRST_VALID_PARSE, line[0]) || !(words = ft_split(line, ' '))) return (ft_error_here(FT_ERR_ILL_ENTRY, line, clist)); - if ((ret = ft_select_get(words, clist)) == 12) - return ((ft_get_map_first_line(line, clist) < 0) ? (-1) : (12)); + if ((ret = ft_select_get(words, clist)) == FT_PARSE_END_RET) + return ((ft_get_map_first_line(line, clist) < 0) ? + (-1) : (FT_PARSE_END_RET)); ft_memdel((void**)&line); return (ret); } @@ -97,7 +99,7 @@ void ft_error(FT_RET_NO_MAP, FT_ERR_NO_MAP, clist); ft_save_name(map_path, clist); ret = 1; - while (ret != 25 && ret >= 0) + while (ret != FT_PARSE_END_RET && ret >= 0) ret = ft_parse_it(fd, clist); (ret == -2) ? (ft_map_error(FT_ERR_ALR_SET, clist)) : 0; (ret == -1) ? (ft_map_error(clist->errmsg, clist)) : 0; |