-
Notifications
You must be signed in to change notification settings - Fork 0
/
tab_fct.c
40 lines (35 loc) · 1.13 KB
/
tab_fct.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* tab_fct.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: lfouquet <lfouquet@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2014/03/26 17:24:46 by midoubih #+# #+# */
/* Updated: 2014/03/27 23:14:21 by lfouquet ### ########.fr */
/* */
/* ************************************************************************** */
#include "minishell.h"
void del_tab(char **tab)
{
int i;
if (tab)
{
i = 0;
while (tab[i])
{
free(tab[i]);
tab[i] = NULL;
i++;
}
free(tab);
}
}
int ft_tablen(char **tab)
{
int res;
res = 0;
while (tab[res])
res++;
return (res);
}