-
Notifications
You must be signed in to change notification settings - Fork 0
/
clear_list.c
32 lines (29 loc) · 1.14 KB
/
clear_list.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
/* ************************************************************************** */
/* */
/* :::::::: */
/* clear_list.c :+: :+: */
/* +:+ */
/* By: jsaariko <jsaariko@student.codam.nl> +#+ */
/* +#+ */
/* Created: 2020/02/16 13:13:27 by jsaariko #+# #+# */
/* Updated: 2020/03/06 11:04:33 by jsaariko ######## odam.nl */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
void clear_list(t_printf_arg **head)
{
t_printf_arg *tmp;
t_printf_arg *cur;
tmp = *head;
cur = *head;
while (tmp != NULL)
{
cur = tmp;
tmp = tmp->next;
if (cur->conv == s)
free(cur->arg.s);
free(cur);
cur = NULL;
}
*head = NULL;
}