replaced write with puts

This commit is contained in:
LinlyBoi
2023-08-22 14:16:30 +03:00
parent 036625ba8c
commit 59e05c91fe

View File

@@ -42,9 +42,9 @@ int _printf(const char *format, ...)
{ {
case 's': case 's':
next = va_arg(args, char*); /*Store string temporarily*/ next = va_arg(args, char*); /*Store string temporarily*/
write(1, next, _strlen(next)); _puts(next);
break; break;
case 'c': /* add 1 byte and i++ */ case 'c':
c = va_arg(args, int); c = va_arg(args, int);
write(1, &c, 1); write(1, &c, 1);
break; break;
@@ -52,13 +52,9 @@ int _printf(const char *format, ...)
break; break;
} }
if (*(format + fmt_idx + 2)) if (*(format + fmt_idx + 2))
{
fmt_idx += 2; fmt_idx += 2;
}
else else
{
fmt_idx += 1; fmt_idx += 1;
}
} }
else else
{ {