refactor the case of c and moved fmt+=2

This commit is contained in:
LinlyBoi
2023-08-21 13:10:04 +03:00
parent c90057710a
commit ccdc076362
2 changed files with 5 additions and 6 deletions

View File

@@ -34,18 +34,17 @@ int _printf(const char *format, ...)
buffer = _strcpy(buffer, next);
BUFF_SIZE = _strlen(buffer);
buff_idx += _strlen(next);
fmt_idx += 2;
break;
case 'c': /* add 1 byte and i++ */
c = va_arg(args, int);
*(buffer + buff_idx + 1) = (char) c;
BUFF_SIZE = _strlen(buffer);
c = (char) va_arg(args, int);
*(buffer + buff_idx) = c;
BUFF_SIZE += 1;
buff_idx += 1;
fmt_idx += 2;
break;
case '%': /*add 1 byte*/
break;
}
fmt_idx += 2;
}
else
{