diff options
author | Christian Neukirchen <chneukirchen@gmail.com> | 2016-06-08 13:18:37 +0200 |
---|---|---|
committer | Christian Neukirchen <chneukirchen@gmail.com> | 2016-06-08 13:18:37 +0200 |
commit | bbbaacf17753152ad3ff902979ecae92aa2bc109 (patch) | |
tree | ab9fcc141c0a68739b6da3d71feb2c662d42e951 /menu.c | |
parent | a889f32af64bc8be266431ada778d55cffb238aa (diff) | |
parent | ffc365bc5d1c5dee337a2869fcc728f46dd262a8 (diff) | |
download | cwm-bbbaacf17753152ad3ff902979ecae92aa2bc109.tar.gz cwm-bbbaacf17753152ad3ff902979ecae92aa2bc109.tar.xz cwm-bbbaacf17753152ad3ff902979ecae92aa2bc109.zip |
cvsimport
* refs/heads/master: If supplied format to menuq_add() is NULL, fill text with an empty string; found by Christian Neukirchen.
Diffstat (limited to 'menu.c')
-rw-r--r-- | menu.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/menu.c b/menu.c index 694d457..e675f65 100644 --- a/menu.c +++ b/menu.c @@ -601,7 +601,10 @@ menuq_add(struct menu_q *mq, void *ctx, const char *fmt, ...) mi->ctx = ctx; va_start(ap, fmt); - (void)vsnprintf(mi->text, sizeof(mi->text), fmt ? fmt : "", ap); + if (fmt != NULL) + (void)vsnprintf(mi->text, sizeof(mi->text), fmt, ap); + else + mi->text[0] = '\0'; va_end(ap); TAILQ_INSERT_TAIL(mq, mi, entry); |