This commit is contained in:
kinou-p 2022-02-14 00:55:59 +01:00
parent 98cf13fc65
commit 5b206e7e9b
2 changed files with 6 additions and 5 deletions

View File

@ -6,7 +6,7 @@
/* By: apommier <apommier@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/02/13 16:42:55 by apommier #+# #+# */
/* Updated: 2022/02/14 00:41:30 by apommier ### ########.fr */
/* Updated: 2022/02/14 00:54:18 by apommier ### ########.fr */
/* */
/* ************************************************************************** */
@ -97,11 +97,10 @@ char **set_map(char **argv)
char *swap;
int fd;
swap = 0;
map = 0;
fd = open(argv[1], O_RDONLY);
if (fd == -1)
ft_error("Error: Open call fail", 0);
ft_error("Error: Open call fail\n", 0);
swap = get_next_line(fd);
while (swap)
{
@ -114,6 +113,8 @@ char **set_map(char **argv)
close(fd);
map_tab = ft_split(map, '\n');
free(map);
if (!map_tab)
ft_error("Error: Map file is empty\n", 0);
return (map_tab);
}

View File

@ -6,7 +6,7 @@
/* By: apommier <apommier@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/02/13 23:39:18 by apommier #+# #+# */
/* Updated: 2022/02/14 00:42:06 by apommier ### ########.fr */
/* Updated: 2022/02/14 00:55:10 by apommier ### ########.fr */
/* */
/* ************************************************************************** */
@ -58,7 +58,7 @@ void check_arg(int argc, char **argv)
{
fd = open(argv[1], O_RDONLY);
if (fd == -1)
ft_error("Error: The map file doesn't exist\n", 0);
ft_error("Error: Map file doesn't exist\n", 0);
close(fd);
}
else