aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_parse_map.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-03-04 16:24:10 +0100
committerJozanLeClerc <bousset.rudy@gmail.com>2020-03-04 16:24:10 +0100
commit93e9d655f14a89477e495aece6d91b07594076d8 (patch)
treee75e792139891fb6007cef8e68cd7f022672c2c0 /src/ft_parse_map.c
parentTab (diff)
download42-cub3d-93e9d655f14a89477e495aece6d91b07594076d8.tar.gz
42-cub3d-93e9d655f14a89477e495aece6d91b07594076d8.tar.bz2
42-cub3d-93e9d655f14a89477e495aece6d91b07594076d8.tar.xz
42-cub3d-93e9d655f14a89477e495aece6d91b07594076d8.tar.zst
42-cub3d-93e9d655f14a89477e495aece6d91b07594076d8.zip
Structs inited
Diffstat (limited to '')
-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);