-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtools.c
40 lines (35 loc) · 1.14 KB
/
tools.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* tools.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: csaidi <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/09/04 17:09:28 by csaidi #+# #+# */
/* Updated: 2024/09/11 10:40:11 by csaidi ### ########.fr */
/* */
/* ************************************************************************** */
#include "minishell.h"
void ft_free(char **ptr)
{
int l;
if (!ptr || !ptr[0])
return ;
l = 0;
while (ptr[l])
{
free(ptr[l]);
l++;
}
free(ptr);
}
int multiple_arg(char **ptr)
{
int l;
l = 0;
while (ptr[l])
l++;
if (l > 1)
return (1);
return (-1);
}