mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
Add %m support to vprintf_callback(3).
This commit is contained in:
parent
9f34e60cbc
commit
af9ea5df04
1 changed files with 7 additions and 3 deletions
|
@ -1,6 +1,6 @@
|
|||
/*******************************************************************************
|
||||
|
||||
Copyright(C) Jonas 'Sortie' Termansen 2011, 2012, 2013.
|
||||
Copyright(C) Jonas 'Sortie' Termansen 2011, 2012, 2013, 2014.
|
||||
|
||||
This file is part of the Sortix C Library.
|
||||
|
||||
|
@ -393,10 +393,14 @@ size_t vprintf_callback(size_t (*callback)(void*, const char*, size_t),
|
|||
else
|
||||
written++;
|
||||
}
|
||||
else if ( *format == 's' && (format++, true) )
|
||||
else if ( *format == 'm' || *format == 's' )
|
||||
{
|
||||
char conversion = *format++;
|
||||
|
||||
const char* string;
|
||||
if ( length == LENGTH_DEFAULT )
|
||||
if ( conversion == 'm' )
|
||||
string = strerror(errno), conversion = 's';
|
||||
else if ( length == LENGTH_DEFAULT )
|
||||
string = va_arg(parameters, const char*);
|
||||
else if ( length == LENGTH_LONG )
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue