-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_vprintf.c
More file actions
37 lines (34 loc) · 1.24 KB
/
Copy pathft_vprintf.c
File metadata and controls
37 lines (34 loc) · 1.24 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
34
35
36
37
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_vprintf.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gwoodwar <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2015/12/14 20:12:43 by gwoodwar #+# #+# */
/* Updated: 2015/12/15 19:00:27 by gwoodwar ### ########.fr */
/* */
/* ************************************************************************** */
#include "includes/ft_printf.h"
int ft_vprintf(const char *format, va_list ap)
{
t_mod m;
size_t i;
int ret;
i = 0;
ret = 0;
while (format[i])
{
if (format[i] == '%')
{
ft_bzero(&m, sizeof(t_mod));
i += get_mod(&format[i + 1], &m, ap) + 1;
ret += print_arg(&m, ap);
continue ;
}
ft_putchar(format[i]);
ret++;
i++;
}
return (ret);
}