menu: menuq_add: avoid passing null pointers to vsnprintf.

This commit is contained in:
Christian Neukirchen 2016-04-02 17:21:04 +02:00
parent f9e9f76856
commit a889f32af6

2
menu.c
View File

@ -601,7 +601,7 @@ menuq_add(struct menu_q *mq, void *ctx, const char *fmt, ...)
mi->ctx = ctx; mi->ctx = ctx;
va_start(ap, fmt); va_start(ap, fmt);
(void)vsnprintf(mi->text, sizeof(mi->text), fmt, ap); (void)vsnprintf(mi->text, sizeof(mi->text), fmt ? fmt : "", ap);
va_end(ap); va_end(ap);
TAILQ_INSERT_TAIL(mq, mi, entry); TAILQ_INSERT_TAIL(mq, mi, entry);