diff options
Diffstat (limited to 'src/ft_init_lists.c')
-rw-r--r-- | src/ft_init_lists.c | 15 |
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); } |