-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflags.c
36 lines (34 loc) · 1.3 KB
/
flags.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* flags.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: qdegraev <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/02/10 12:11:48 by qdegraev #+# #+# */
/* Updated: 2016/02/22 13:04:51 by qdegraev ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
void check_flags(char *f, t_arg *a)
{
while (f[a->i] == '-' || f[a->i] == '+' || f[a->i] == ' ' || f[a->i] == '#'
|| f[a->i] == '0')
{
if (f[a->i] == '-')
a->f_m = 1;
if (f[a->i] == '+')
a->f_p = 1;
if (f[a->i] == ' ')
a->f_sp = 1;
if (f[a->i] == '#')
a->f_h = 1;
if (f[a->i] == '0')
a->f_zero = 1;
if (f[a->i + 1] != '\0')
a->i++;
else
return ;
}
check_min_lenght(f, a);
}