-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtype_c.c
More file actions
33 lines (31 loc) · 1.22 KB
/
Copy pathtype_c.c
File metadata and controls
33 lines (31 loc) · 1.22 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
31
32
33
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* type_c.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: vvarodi <vvarodi@student.42madrid.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/08/14 01:03:29 by vvarodi #+# #+# */
/* Updated: 2020/08/19 00:28:14 by vvarodi ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
char *type_c(t_buffer *b, t_flags *f, int c, char *str)
{
if (f->b_left_aligned)
{
add_to_buffer(b, f, c);
while (f->width > 0)
add_to_buffer(b, f, ' ');
}
else
{
while (f->width > 1)
{
f->b_zero_padding ? add_to_buffer(b, f, '0') :
add_to_buffer(b, f, ' ');
}
add_to_buffer(b, f, c);
}
return (str);
}