-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathparse_flags.c
33 lines (31 loc) · 1.26 KB
/
parse_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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* parse_flags.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: alischyn <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/03/22 16:59:14 by alischyn #+# #+# */
/* Updated: 2017/03/22 17:05:13 by alischyn ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
const char *parse_flags(t_fmt *fmt, const char *f)
{
while (*f != '\0')
{
if (*f == '+' && f++)
fmt->f_plus = true;
else if (*f == '-' && f++)
fmt->f_minus = true;
else if (*f == '0' && f++)
fmt->f_zero = true;
else if (*f == '#' && f++)
fmt->f_octo = true;
else if (*f == ' ' && f++)
fmt->f_space = true;
else
break ;
}
return (f);
}