corrige deux bad read or write due au depassement de la taille de map, en ajoutant total_num dans la struct
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
/* By: vmanzoni <vmanzoni@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2019/03/01 13:29:05 by vmanzoni #+# #+# */
|
||||
/* Updated: 2019/05/28 11:26:25 by hulamy ### ########.fr */
|
||||
/* Updated: 2019/05/28 17:27:17 by hulamy ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
void print_error(char *str)
|
||||
{
|
||||
write(1, str, ft_strlen(str));
|
||||
// exit(1);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -31,22 +31,19 @@ void print_error(char *str)
|
||||
void print_error_extended(int error, int *dope)
|
||||
{
|
||||
if (!dope[3])
|
||||
{
|
||||
print_error("error\n");
|
||||
exit(0);
|
||||
}
|
||||
if (error == 1)
|
||||
ft_putstr("error: File contains char other than '.','#' and '\\n'.\n");
|
||||
print_error("error: File contains char other than '.','#' and '\\n'\n");
|
||||
if (error == 2)
|
||||
ft_putstr("error: File contains more than 2 '\\n' in a row.\n");
|
||||
print_error("error: File contains more than 2 '\\n' in a row\n");
|
||||
if (error == 3)
|
||||
ft_putstr("error: File contains less than 1 tetrimino "
|
||||
"or more than 26.\n");
|
||||
print_error("error: File contains less than 1 tetrimino "
|
||||
"or more than 26\n");
|
||||
if (error == 4)
|
||||
ft_putstr("error: Tetrimino has more or less than 4 #.\n");
|
||||
print_error("error: Tetrimino has more or less than 4 #\n");
|
||||
if (error == 5)
|
||||
ft_putstr("error: Tetrimino # are not all connected.\n");
|
||||
// exit(1);
|
||||
print_error("error: Tetrimino # are not all connected\n");
|
||||
print_error("error\n");
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user