This commit is contained in:
LinlyBoi
2023-08-22 14:25:46 +03:00
parent 59e05c91fe
commit 297cf9c4a5
3 changed files with 20 additions and 6 deletions

View File

@@ -11,7 +11,7 @@
int _printf(const char *format, ...)
{
int buff_idx, fmt_idx;
unsigned int identifiers, BUFF_SIZE;
unsigned int identifiers, BUFF_SIZE, printed;
char *buffer, *next, c;
va_list args;
@@ -26,6 +26,7 @@ int _printf(const char *format, ...)
buff_idx = 0;
fmt_idx = 0;
printed = 0;
while (*(format + fmt_idx))
{
if ((*(format + fmt_idx) == '%') && (*(format + fmt_idx + 1)))
@@ -68,5 +69,6 @@ int _printf(const char *format, ...)
_puts(buffer);
free(buffer);
}
return (_strlen(buffer));
_putchar('\0');
return (printed);
}