-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcleaning_split.c
More file actions
48 lines (43 loc) · 1.22 KB
/
Copy pathcleaning_split.c
File metadata and controls
48 lines (43 loc) · 1.22 KB
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* cleaning_split.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: nmagdano <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/07/09 13:40:27 by nmagdano #+# #+# */
/* Updated: 2024/04/01 23:30:28 by nmagdano ### ########.fr */
/* */
/* ************************************************************************** */
#include "fdf.h"
void clean_split(char **arr, size_t n)
{
size_t i;
if (*arr)
{
i = 0;
while (i < n)
{
if (*arr != NULL)
free(*arr);
arr++;
i++;
}
}
return ;
}
void clean_all_split(char **arr, size_t n)
{
size_t i;
i = 0;
if (arr[i] && n)
{
while (arr[i])
{
free(arr[i]);
i++;
}
free(arr[i]);
}
return ;
}