aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_parse_map.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ft_parse_map.c')
-rw-r--r--src/ft_parse_map.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ft_parse_map.c b/src/ft_parse_map.c
index d3a90af..6a9c5af 100644
--- a/src/ft_parse_map.c
+++ b/src/ft_parse_map.c
@@ -75,13 +75,13 @@ static int8_t
}
void
- ft_save_name(t_map *mlist, t_cub *clist)
+ ft_save_name(const char *map_path, t_map *mlist, t_cub *clist)
{
ft_memdel((void**)mlist->filename);
if (!(mlist->filename =
(char*)malloc((ft_strlen(map_path) + 1) * sizeof(char))))
ft_error(FT_RET_ALLOC_ERR, FT_ERR_ALLOCATE, clist);
- ft_sprintf(mlist->filename, map_path);
+ ft_sprintf(mlist->filename, "%s", map_path);
}
void
@@ -92,10 +92,10 @@ void
if (ft_check_ext(map_path, ".cub") < 0)
ft_map_error(FT_ERR_NOT_A_CUB, clist);
- ft_save_name(&clist->mlist, clist);
fd = open(map_path, O_RDONLY);
if (fd < 0)
ft_error(FT_RET_NO_MAP, FT_ERR_NO_MAP, clist);
+ ft_save_name(map_path, &clist->mlist, clist);
ret = 1;
while (ret != 12 && ret >= 0)
ret = ft_parse_it(fd, clist);