Support field widths in %c printf conversion.

This commit is contained in:
Jonas 'Sortie' Termansen 2013-03-18 14:22:48 +01:00
parent 4e46b40b4c
commit 8180797aa7
1 changed files with 5 additions and 1 deletions

View File

@ -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;
}
}