From 92ff90257b33b74ec98d611a60815bdc7a89548a Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Fri, 24 Jan 2020 18:05:37 +0100 Subject: Added a second map for error management --- map/map_two.cub | 2 ++ src/ft_get_tex.c | 3 +++ 2 files changed, 5 insertions(+) create mode 100644 map/map_two.cub diff --git a/map/map_two.cub b/map/map_two.cub new file mode 100644 index 0000000..2f45994 --- /dev/null +++ b/map/map_two.cub @@ -0,0 +1,2 @@ +R 800 600 +NO ./path_to_the_north_texture \ No newline at end of file diff --git a/src/ft_get_tex.c b/src/ft_get_tex.c index 5bd7a4f..65c8441 100644 --- a/src/ft_get_tex.c +++ b/src/ft_get_tex.c @@ -37,7 +37,10 @@ ft_get_tex_so(int fd, t_win *wlist) return (ft_exit(5, wlist)); if (!(*words) || ft_strcmp(*words, "SO") || !(*(words + 1)) || (*(words + 2))) + { + /* ft_free_words(words); */ return (ft_map_error(3, wlist)); + } ft_memdel(wlist->clist->so_tex_path); len = ft_strlen(*(words + 1)); if (!(wlist->clist->so_tex_path = (char*)malloc((len + 1) * sizeof(char)))) -- cgit v1.2.3