-
Notifications
You must be signed in to change notification settings - Fork 0
/
flags_positive.c
29 lines (27 loc) · 1.13 KB
/
flags_positive.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* flags_postitive.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: nahmed-m <nahmed-m@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/01/19 20:30:39 by nahmed-m #+# #+# */
/* Updated: 2016/02/01 02:20:55 by nahmed-m ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
void flags_positive(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_positive = 1;
e->i++;
}
}
else
e->f_positive = 0;
}