mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
Support field widths in %c printf conversion.
This commit is contained in:
parent
4e46b40b4c
commit
8180797aa7
1 changed files with 5 additions and 1 deletions
|
@ -23,7 +23,7 @@
|
|||
*******************************************************************************/
|
||||
|
||||
// Number of bugs seemingly unrelated bugs that have been traced to here:
|
||||
// Countless + 1
|
||||
// Countless + 2
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdint.h>
|
||||
|
@ -510,8 +510,12 @@ extern "C" size_t vprintf_callback(size_t (*callback)(void*, const char*, size_t
|
|||
case CHARACTER:
|
||||
{
|
||||
int c = va_arg(parameters, int);
|
||||
size_t len = 1;
|
||||
size_t chars = len;
|
||||
if ( prepend_chars && chars < field_width ) { REPEAT_BLANKS(field_width - chars); }
|
||||
if ( READY_SIZE <= readylen ) { READY_FLUSH(); }
|
||||
ready[readylen++] = c;
|
||||
if ( append_chars && chars < field_width ) { REPEAT_BLANKS(field_width - chars); }
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue