Files
ft_printf/libftprintf/ft_vprintf.c

35 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 #+# #+# */
/* Updated: 2022/04/24 00:36:07 by gbaconni ### lausanne.ch */
2022-04-13 08:01:46 +02:00
/* */
/* ************************************************************************** */
#include "libftprintf.h"
int ft_vprintf(char const *format, va_list ap)
{
int ret;
const char *fmt;
2022-04-13 08:01:46 +02:00
ret = 0;
fmt = format;
while (*fmt != 0)
2022-04-13 08:01:46 +02:00
{
if (*fmt == '%')
{
fmt++;
ret += ft_vprintf_percent(fmt, ap);
}
2022-04-13 08:01:46 +02:00
else
ret += ft_vprintf_other(fmt, ap);
fmt++;
2022-04-13 08:01:46 +02:00
}
return (ret);
}