Bonus first try

This commit is contained in:
gbaconni
2022-04-26 17:53:39 +02:00
parent 2a2f6f3a9d
commit d9fc240b0e
10 changed files with 115 additions and 45 deletions

View File

@@ -6,7 +6,7 @@
/* By: gbaconni@student.42lausanne.ch +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/01/20 11:43:52 by gbaconni #+# #+# */
/* Updated: 2022/04/26 12:04:14 by gbaconni ### ########.fr */
/* Updated: 2022/04/26 15:20:34 by gbaconni ### ########.fr */
/* */
/* ************************************************************************** */
@@ -15,21 +15,19 @@
int ft_vprintf(char const *format, va_list ap)
{
int ret;
const char *fmt;
ret = 0;
fmt = format;
while (*fmt != 0)
while (*format != 0)
{
if (*fmt == '%')
if (*format == '%')
{
fmt++;
fmt += ft_eoflags(fmt);
ret += ft_vprintf_percent(fmt, ap);
format++;
ret += ft_vprintf_percent(format, ap);
format += ft_eoflags(format);
}
else
ret += ft_vprintf_other(fmt, ap);
fmt++;
ret += ft_vprintf_other(format, ap);
format++;
}
return (ret);
}