Skip to content

Commit

Permalink
fixed for bettystyle
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenni-Foued committed Oct 30, 2020
1 parent 2936446 commit 774feb9
Showing 1 changed file with 25 additions and 15 deletions.
40 changes: 25 additions & 15 deletions _printf.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,25 +43,35 @@ int _printf(const char *format, ...)
return (-1);
va_start(arg, format);
for (; format && format[i]; i++)
{if (format[i] == '%')
{if (format[i + 1] == '%')
{_putchar(format[i]);
i++;
p_counter++; }
{
if (format[i] == '%')
{
if (format[i + 1] == '%')
{
_putchar(format[i]);
i++;
p_counter++;
}
else if (format[i + 1] == '\0')
{_putchar(format[i]);
{
_putchar(format[i]);
p_counter++;
return (p_counter); }
return (p_counter);
}
else
{f = printer(format[i + 1]);
{
f = printer(format[i + 1]);
if (f != NULL)
{p_counter += f(arg);
i++; }
{
p_counter += f(arg);
i++;
}
else
{_putchar(format[i]);
p_counter++; }}}
{
_putchar(format[i]);
p_counter++; } } }
else
{_putchar(format[i]);
p_counter++; }}
{ _putchar(format[i]);
p_counter++; } }
va_end(arg);
return (p_counter); }
return (p_counter); }

0 comments on commit 774feb9

Please sign in to comment.