aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_get_map.c
diff options
context:
space:
mode:
authorRudy Bousset <rbousset@z2r5p6.le-101.fr>2020-02-02 17:05:54 +0100
committerRudy Bousset <rbousset@z2r5p6.le-101.fr>2020-02-02 17:05:54 +0100
commit8d7f65c1c04f7124f1a34062be377fdbe721c46a (patch)
tree36ef68573148ba58843608a499504138cca3595d /src/ft_get_map.c
parentRemoved whitespace (diff)
download42-cub3d-8d7f65c1c04f7124f1a34062be377fdbe721c46a.tar.gz
42-cub3d-8d7f65c1c04f7124f1a34062be377fdbe721c46a.tar.bz2
42-cub3d-8d7f65c1c04f7124f1a34062be377fdbe721c46a.tar.xz
42-cub3d-8d7f65c1c04f7124f1a34062be377fdbe721c46a.tar.zst
42-cub3d-8d7f65c1c04f7124f1a34062be377fdbe721c46a.zip
Correct ft_memdel
Diffstat (limited to 'src/ft_get_map.c')
-rw-r--r--src/ft_get_map.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/ft_get_map.c b/src/ft_get_map.c
index 3844f41..adedf7c 100644
--- a/src/ft_get_map.c
+++ b/src/ft_get_map.c
@@ -40,22 +40,22 @@ ft_get_map_first_line(char *line, t_cub *clist)
{
if (!line[0])
{
- ft_memdel(line);
+ ft_memdel((void**)&line);
return (-1);
}
clist->map_w = ft_get_line_len(line);
if (ft_check_map_line(line, 1, clist) < 0)
{
- ft_memdel(line);
+ ft_memdel((void**)&line);
return (-1);
}
- clist->mapl = NULL;
+ ft_memdel((void**)&clist->mapl);
if (ft_cat_mapl(line, 0, clist) < 0)
{
- ft_memdel(line);
+ ft_memdel((void**)&line);
return (-1);
}
- ft_memdel(line);
+ ft_memdel((void**)&line);
return (1);
}
@@ -75,15 +75,15 @@ ft_get_map_core(int fd, t_cub *clist)
if (!line[0] || ft_check_map_line(line, 0, clist) < 0
|| ft_cat_mapl(line, i, clist) < 0)
{
- ft_memdel(line);
+ ft_memdel((void**)&line);
return (-1);
}
- ft_memdel(line);
+ ft_memdel((void**)&line);
i++;
}
clist->mapl[((clist->map_w + 1) * i) - 1] = '\0';
ft_free_words(clist->map);
clist->map = ft_split(clist->mapl, '\n');
- ft_memdel(clist->mapl);
+ ft_memdel((void**)&clist->mapl);
return (0);
}