-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathget_flags.c
32 lines (29 loc) · 1.23 KB
/
get_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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* get_flags.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gmelisan <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/01/28 14:47:27 by gmelisan #+# #+# */
/* Updated: 2019/01/29 17:53:53 by gmelisan ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
void get_flags(t_conversion *conv, const char *format, int *p_i)
{
int i;
i = *p_i;
if (format[i] == '#')
conv->flags.hash = 1;
if (format[i] == '0')
conv->flags.zero = 1;
if (format[i] == '-')
conv->flags.minus = 1;
if (format[i] == ' ')
conv->flags.space = 1;
if (format[i] == '+')
conv->flags.plus = 1;
i++;
*p_i = i;
}