Files
ft_printf/libftprintf/ft_vprintf.c

34 lines
1.2 KiB
C
Raw Normal View History

2022-04-13 08:01:46 +02:00
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_vprintf.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gbaconni@student.42lausanne.ch +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/01/20 11:43:52 by gbaconni #+# #+# */
2022-04-29 15:18:54 +02:00
/* Updated: 2022/04/29 14:19:39 by gbaconni ### ########.fr */
2022-04-13 08:01:46 +02:00
/* */
/* ************************************************************************** */
#include "libftprintf.h"
int ft_vprintf(char const *format, va_list ap)
{
int ret;
2022-04-13 08:01:46 +02:00
ret = 0;
2022-04-26 17:53:39 +02:00
while (*format != 0)
2022-04-13 08:01:46 +02:00
{
2022-04-26 17:53:39 +02:00
if (*format == '%')
{
2022-04-26 17:53:39 +02:00
format++;
2022-04-29 15:18:54 +02:00
ret += ft_va_percent(format, ap);
2022-04-26 17:53:39 +02:00
format += ft_eoflags(format);
}
2022-04-13 08:01:46 +02:00
else
2022-04-29 15:18:54 +02:00
ret += ft_va_other(format, ap);
2022-04-26 17:53:39 +02:00
format++;
2022-04-13 08:01:46 +02:00
}
return (ret);
}