Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
JennyHadir committed Oct 30, 2020
1 parent 030213c commit 2936446
Showing 1 changed file with 15 additions and 33 deletions.
48 changes: 15 additions & 33 deletions _printf.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,43 +43,25 @@ 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 2936446

Please sign in to comment.