From 29b45c0bbdcc3a8eb980d6fdc65efa09382c0ede Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Sun, 26 Jan 2020 22:28:11 +0100 Subject: Can't believe it --- src/ft_init_lists.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/ft_init_lists.c') 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); } -- cgit v1.2.3