aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_init_lists.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-01-26 22:28:11 +0100
committerJozanLeClerc <bousset.rudy@gmail.com>2020-01-26 22:28:11 +0100
commit29b45c0bbdcc3a8eb980d6fdc65efa09382c0ede (patch)
treea6060e809807384d96099df120d0c423d1da09b1 /src/ft_init_lists.c
parentBetter error management (diff)
download42-cub3d-29b45c0bbdcc3a8eb980d6fdc65efa09382c0ede.tar.gz
42-cub3d-29b45c0bbdcc3a8eb980d6fdc65efa09382c0ede.tar.bz2
42-cub3d-29b45c0bbdcc3a8eb980d6fdc65efa09382c0ede.tar.xz
42-cub3d-29b45c0bbdcc3a8eb980d6fdc65efa09382c0ede.tar.zst
42-cub3d-29b45c0bbdcc3a8eb980d6fdc65efa09382c0ede.zip
Can't believe it
Diffstat (limited to '')
-rw-r--r--src/ft_init_lists.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/ft_init_lists.c b/src/ft_init_lists.c
index 6bec697..b395840 100644
--- a/src/ft_init_lists.c
+++ b/src/ft_init_lists.c
@@ -24,13 +24,18 @@ t_cub
if (!(clist = (t_cub*)malloc(sizeof(t_cub))))
return (NULL);
- if (!(clist->no_tex_path = (char*)ft_calloc(1, 1)) ||
- !(clist->so_tex_path = (char*)ft_calloc(1, 1)) ||
- !(clist->ea_tex_path = (char*)ft_calloc(1, 1)) ||
- !(clist->we_tex_path = (char*)ft_calloc(1, 1)) ||
- !(clist->sprite_path = (char*)ft_calloc(1, 1)))
+ if (!(clist->no_tex_path = (char*)ft_calloc(1, sizeof(char))) ||
+ !(clist->so_tex_path = (char*)ft_calloc(1, sizeof(char))) ||
+ !(clist->ea_tex_path = (char*)ft_calloc(1, sizeof(char))) ||
+ !(clist->we_tex_path = (char*)ft_calloc(1, sizeof(char))) ||
+ !(clist->sprite_path = (char*)ft_calloc(1, sizeof(char))))
return (NULL);
clist->f_color = 0;
clist->c_color = 0;
+ if (!(clist->map = (char**)ft_calloc(2, sizeof(char*))))
+ return (NULL);
+ if (!(clist->map[0] = (char*)ft_calloc(1, sizeof(char))))
+ return (NULL);
+ clist->map[1] = 0;
return (clist);
}