-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflags_space.c
33 lines (31 loc) · 1.22 KB
/
flags_space.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* flags_space.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: nahmed-m <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/01/19 20:37:17 by nahmed-m #+# #+# */
/* Updated: 2016/01/30 21:54:18 by nahmed-m ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
void flags_space(char *fmt, t_var *e)
{
if (fmt[e->i] == ' ' && fmt[e->i + 1] == '\0')
e->error = 1;
else if (fmt[e->i] == ' ')
{
while (fmt[e->i] == ' ')
{
e->f_space = 1;
e->i++;
if (fmt[e->i] == '+')
flags_positive(fmt, e);
if (fmt[e->i] == '0')
flags_zero(fmt, e);
}
}
else
e->f_space = 0;
}