1
0

🔨」 fix: It work on my machine also now 🎉

This commit is contained in:
2024-09-11 11:15:52 +02:00
parent e1b112a5c0
commit a11b159e50
7 changed files with 10 additions and 12 deletions

44
src/cub3d.c Normal file
View File

@ -0,0 +1,44 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* cub3d.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: madumerg <madumerg@42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/09/04 16:58:27 by madumerg #+# #+# */
/* Updated: 2024/09/11 11:10:39 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */
#include "cub3d.h"
char **ft_parse_map(char *map)
{
int fd;
char **parse_map;
char *save;
char *join;
fd = open(map, O_RDONLY);
save = get_next_line(fd);
join = ft_calloc(1, 1);
if (!join)
return (NULL);
while (save != NULL)
{
join = ft_strjoin(join, save);
free(save);
save = get_next_line(fd);
}
parse_map = ft_split(join, '\n');
free(join);
close(fd);
return (parse_map);
}
int main(int ac, char **av)
{
if (check_err_arg(ac, av) == 1)
return (1);
return (0);
}