tweaks: don't call va_start() without calling va_end() [coverity scan]

This commit is contained in:
Benno Schulenberg 2018-07-14 21:15:23 +02:00
parent 14b9a42f5b
commit 89c0e7493f

View File

@ -2157,6 +2157,11 @@ void statusline(message_type importance, const char *msg, ...)
UNSET(WHITESPACE_DISPLAY);
#endif
/* Ignore a message with an importance that is lower than the last one. */
if ((lastmessage == ALERT && importance != ALERT) ||
(lastmessage == MILD && importance == HUSH))
return;
va_start(ap, msg);
/* Curses mode is turned off. If we use wmove() now, it will muck
@ -2168,11 +2173,6 @@ void statusline(message_type importance, const char *msg, ...)
return;
}
/* If there already was an alert message, ignore lesser ones. */
if ((lastmessage == ALERT && importance != ALERT) ||
(lastmessage == MILD && importance == HUSH))
return;
/* If the ALERT status has been reset, reset the counter. */
if (lastmessage == HUSH)
alerts = 0;