-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_flags.c
More file actions
30 lines (28 loc) · 1.14 KB
/
ft_flags.c
File metadata and controls
30 lines (28 loc) · 1.14 KB
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_flags.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gconde-m <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/11/26 08:54:32 by gconde-m #+# #+# */
/* Updated: 2019/12/27 09:00:07 by gconde-m ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
void ft_flags(t_struct *str)
{
while (*str->print == '0' || *str->print == '-')
{
if (*str->print == '-')
{
str->flag = 1;
str->print++;
}
if (*str->print == '0')
{
str->flag = str->flag == 1 ? 1 : 2;
str->print++;
}
}
}