aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_get_res.c
diff options
context:
space:
mode:
authorRudy Bousset <rbousset@z2r5p2.le-101.fr>2020-01-27 19:20:28 +0100
committerRudy Bousset <rbousset@z2r5p2.le-101.fr>2020-01-27 19:20:28 +0100
commit0c2bb0f610c0af0680b46fc4566a207d59781e4d (patch)
tree986d6dd6a19416593c9b2c043312ffa5d4f0be73 /src/ft_get_res.c
parentin progress (diff)
download42-cub3d-0c2bb0f610c0af0680b46fc4566a207d59781e4d.tar.gz
42-cub3d-0c2bb0f610c0af0680b46fc4566a207d59781e4d.tar.bz2
42-cub3d-0c2bb0f610c0af0680b46fc4566a207d59781e4d.tar.xz
42-cub3d-0c2bb0f610c0af0680b46fc4566a207d59781e4d.tar.zst
42-cub3d-0c2bb0f610c0af0680b46fc4566a207d59781e4d.zip
Switched lists entierly
Diffstat (limited to 'src/ft_get_res.c')
-rw-r--r--src/ft_get_res.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/ft_get_res.c b/src/ft_get_res.c
index 337d3d7..66eb1df 100644
--- a/src/ft_get_res.c
+++ b/src/ft_get_res.c
@@ -2,7 +2,7 @@
#include <cub3d.h>
static void
-ft_checkdigit(const char *word, t_win *wlist)
+ft_checkdigit(const char *word, t_cub *clist)
{
size_t i;
@@ -10,11 +10,11 @@ ft_checkdigit(const char *word, t_win *wlist)
while (ft_isdigit(word[i]))
i++;
if (i != ft_strlen(word))
- ft_map_error(1, wlist);
+ ft_map_error(1, clist);
}
int
-ft_get_res(int fd, t_win *wlist)
+ft_get_res(int fd, t_cub *clist)
{
char *line;
char **words;
@@ -22,18 +22,18 @@ ft_get_res(int fd, t_win *wlist)
if (get_next_line(fd, &line) <= 0 || !(words = ft_split(line, ' ')))
{
ft_memdel(line);
- return (ft_map_error(1, wlist));
+ return (ft_map_error(1, clist));
}
if (!(*words) || ft_strcmp(*words, "R") || !(*(words + 1))
|| !(*(words + 2)) || (*(words + 3)))
{
ft_free_words(words, line);
- return (ft_map_error(1, wlist));
+ return (ft_map_error(1, clist));
}
- ft_checkdigit(words[1], wlist);
- ft_checkdigit(words[2], wlist);
- wlist->x_size = ft_atoi(words[1]);
- wlist->y_size = ft_atoi(words[2]);
+ ft_checkdigit(words[1], clist);
+ ft_checkdigit(words[2], clist);
+ clist->wlist->x_size = ft_atoi(words[1]);
+ clist->wlist->y_size = ft_atoi(words[2]);
ft_free_words(words, line);
return (0);
}