Files
ft_printf/libftprintf/ft_vprintf.c

32 lines
1.2 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_vprintf.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gbaconni@student.42lausanne.ch +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/01/20 11:43:52 by gbaconni #+# #+# */
/* Updated: 2022/04/18 09:01:19 by gbaconni ### lausanne.ch */
/* */
/* ************************************************************************** */
#include "libftprintf.h"
int ft_vprintf(char const *format, va_list ap)
{
int ret;
ret = 0;
while (*format != 0)
{
if (*format == '%')
ret += ft_vprintf_percent(++format, ap);
else if (*format == '\\')
ret += ft_vprintf_escape(++format, ap);
else
ret += ft_vprintf_other(format, ap);
format++;
}
return (ret);
}