From 89c0e7493f47ee0c4b4b759ac8bd5de2d9c80b5f Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Sat, 14 Jul 2018 21:15:23 +0200 Subject: [PATCH] tweaks: don't call va_start() without calling va_end() [coverity scan] --- src/winio.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/winio.c b/src/winio.c index 7e177a7e..d6d1df81 100644 --- a/src/winio.c +++ b/src/winio.c @@ -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;