mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
Handle NULL strings in vprintf_callback(3).
This commit is contained in:
parent
564f99b3ae
commit
e8cfd5bf85
1 changed files with 3 additions and 0 deletions
|
@ -411,6 +411,9 @@ size_t vprintf_callback(size_t (*callback)(void*, const char*, size_t),
|
|||
else
|
||||
goto incomprehensible_conversion;
|
||||
|
||||
if ( conversion == 's' && !string )
|
||||
string = "(null)";
|
||||
|
||||
size_t string_length = 0;
|
||||
for ( size_t i = 0; i < precision && string[i]; i++ )
|
||||
string_length++;
|
||||
|
|
Loading…
Reference in a new issue