ply-console-viewer: Don't crash if passed a NULL format

The splash plugins currently call

ply_console_viewer_print (... NULL);

if no prompt message is specified... This leads to crash.

Rather than fixing all the splash plugins, this commit just makes
a NULL format be a noop.
This commit is contained in:
Ray Strode 2023-12-18 08:52:00 -05:00
parent d7c2e3a4ac
commit 606f8c232b

View file

@ -341,6 +341,9 @@ ply_console_viewer_print (ply_console_viewer_t *console_viewer,
char *buffer = NULL;
int length;
if (format == NULL)
return;
va_start (arguments, format);
length = vsnprintf (NULL, 0, format, arguments);
if (length > 0)