printf improvements
This commit is contained in:
parent
fe7f798506
commit
b6bdcc979e
@ -13,7 +13,7 @@ static void print_dec(unsigned int value, unsigned int width, char * buf, int *
|
||||
|
||||
int printed = 0;
|
||||
while (n_width + printed < width) {
|
||||
buf[*ptr] = '0';
|
||||
buf[*ptr] = ' ';
|
||||
*ptr += 1;
|
||||
printed += 1;
|
||||
}
|
||||
@ -77,6 +77,10 @@ size_t vasprintf(char * buf, const char * fmt, va_list args) {
|
||||
align = 0;
|
||||
++f;
|
||||
}
|
||||
if (*f == '*') {
|
||||
arg_width = (char)va_arg(args, int);
|
||||
++f;
|
||||
}
|
||||
while (*f >= '0' && *f <= '9') {
|
||||
arg_width *= 10;
|
||||
arg_width += *f - '0';
|
||||
|
Loading…
Reference in New Issue
Block a user