-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_freetab.c
36 lines (33 loc) · 1.16 KB
/
ft_freetab.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_freetab.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: malexand <malexand@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/11/16 15:45:12 by malexand #+# #+# */
/* Updated: 2017/02/16 17:34:16 by malexand ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_freetab(char **tab)
{
int count;
count = 0;
if (tab == NULL)
{
free(tab);
tab = NULL;
return ;
}
while (tab[count])
{
ft_strdel(&tab[count]);
tab[count] = NULL;
count++;
}
ft_strdel(&tab[count]);
tab[count] = NULL;
free(tab);
tab = NULL;
}