1
0
Fork 0
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:
Jonas 'Sortie' Termansen 2014-02-18 15:43:08 +01:00
parent 564f99b3ae
commit e8cfd5bf85

View file

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