aboutsummaryrefslogtreecommitdiff
path: root/helper.c
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-01-11 12:37:34 +0100
committerCharles <sircharlesaze@gmail.com>2020-01-11 12:37:34 +0100
commitcff05e83256a67b8cb23b16b1e1e6f761ff52f4c (patch)
tree33eb6eae520a085d6774205601f13d07dc99aaf9 /helper.c
parent0dcba6ff7e68ed13f8e6caadd80b77506b917050 (diff)
downloadcub3d-cff05e83256a67b8cb23b16b1e1e6f761ff52f4c.tar.gz
cub3d-cff05e83256a67b8cb23b16b1e1e6f761ff52f4c.tar.bz2
cub3d-cff05e83256a67b8cb23b16b1e1e6f761ff52f4c.zip
fixing a few segfault, map border checking
Diffstat (limited to 'helper.c')
-rw-r--r--helper.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/helper.c b/helper.c
index fb16406..cdbd8d1 100644
--- a/helper.c
+++ b/helper.c
@@ -6,7 +6,7 @@
/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/01/11 07:32:20 by cacharle #+# #+# */
-/* Updated: 2020/01/11 10:37:54 by cacharle ### ########.fr */
+/* Updated: 2020/01/11 11:22:15 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */
@@ -20,9 +20,12 @@ t_bool helper_is_player_cell(t_cell cell)
void helper_free_splited(char **splited)
{
+ int i;
+
if (splited == NULL)
return ;
- while (splited != NULL)
- free(*splited++);
+ i = -1;
+ while (splited[++i] != NULL)
+ free(splited[i]);
free(splited);
}