|
|
|
@ -70,12 +70,19 @@ typedef void (*out_fct_type)(char character, char* buffer, size_t idx, size_t ma
|
|
|
|
|
// internal buffer output
|
|
|
|
|
static inline void _out_buffer(char character, char* buffer, size_t idx, size_t maxlen)
|
|
|
|
|
{
|
|
|
|
|
if (!!buffer && (idx < maxlen)) {
|
|
|
|
|
if (idx < maxlen) {
|
|
|
|
|
buffer[idx] = character;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// internal null output
|
|
|
|
|
static inline void _out_null(char character, char* buffer, size_t idx, size_t maxlen)
|
|
|
|
|
{
|
|
|
|
|
(void)character; (void)buffer; (void)idx; (void)maxlen;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// internal _putchar wrapper
|
|
|
|
|
static inline void _out_char(char character, char* buffer, size_t idx, size_t maxlen)
|
|
|
|
|
{
|
|
|
|
@ -363,6 +370,11 @@ static int _vsnprintf(out_fct_type out, char* buffer, const size_t maxlen, const
|
|
|
|
|
unsigned int flags, width, precision, n;
|
|
|
|
|
size_t idx = 0U;
|
|
|
|
|
|
|
|
|
|
if (!buffer) {
|
|
|
|
|
// use null output function
|
|
|
|
|
out = _out_null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
while (*format)
|
|
|
|
|
{
|
|
|
|
|
// format specifier? %[flags][width][.precision][length]
|
|
|
|
|