-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfree_arrays.c
49 lines (44 loc) · 1.26 KB
/
free_arrays.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* free_arrays.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: emende <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/04/02 13:06:38 by emende #+# #+# */
/* Updated: 2022/04/09 19:27:45 by emende ### ########.fr */
/* */
/* ************************************************************************** */
#include "fdf.h"
int free_strarr(char ***split)
{
int i;
i = 0;
if (split && *split)
{
while ((*split)[i])
{
free((*split)[i]);
i++;
}
free(*split);
}
*split = NULL;
return (1);
}
int free_intarr(int ***split, int length)
{
int i;
i = 0;
if (split && *split)
{
while (i < length)
{
free((*split)[i]);
i++;
}
free(*split);
}
*split = NULL;
return (1);
}