From: Richard Russon Date: Mon, 13 Nov 2017 02:39:04 +0000 (+0000) Subject: highlight preproc-like variable X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2b7c87b7a5b4747f42c089e584eaaacde1c225c1;p=neomutt highlight preproc-like variable `allow_skip` is only set in one place in a `#ifdef`d block. This effectively makes it a preprocessor condition. By changing its name to capitals we let Coverity know how we're using the variable. --- diff --git a/conn/ssl.c b/conn/ssl.c index a0a2112cc..2a1bbc625 100644 --- a/conn/ssl.c +++ b/conn/ssl.c @@ -971,7 +971,7 @@ static int interactive_check_cert(X509 *cert, int idx, int len, SSL *ssl, int al struct Menu *menu = mutt_new_menu(MENU_GENERIC); int done, row; FILE *fp = NULL; - int allow_skip = 0; + int ALLOW_SKIP = 0; /**< All caps tells Coverity that this is effectively a preproc condition */ mutt_push_current_menu(menu); @@ -1019,7 +1019,7 @@ static int interactive_check_cert(X509 *cert, int idx, int len, SSL *ssl, int al /* The leaf/host certificate can't be skipped. */ #ifdef HAVE_SSL_PARTIAL_CHAIN if ((idx != 0) && (option(OPT_SSL_VERIFY_PARTIAL_CHAINS))) - allow_skip = 1; + ALLOW_SKIP = 1; #endif /* Inside ssl_verify_callback(), this function is guarded by a call to @@ -1039,14 +1039,14 @@ static int interactive_check_cert(X509 *cert, int idx, int len, SSL *ssl, int al menu->keys = _("roas"); if (allow_always) { - if (allow_skip) + if (ALLOW_SKIP) menu->prompt = _("(r)eject, accept (o)nce, (a)ccept always, (s)kip"); else menu->prompt = _("(r)eject, accept (o)nce, (a)ccept always"); } else { - if (allow_skip) + if (ALLOW_SKIP) menu->prompt = _("(r)eject, accept (o)nce, (s)kip"); else menu->prompt = _("(r)eject, accept (o)nce"); @@ -1097,7 +1097,7 @@ static int interactive_check_cert(X509 *cert, int idx, int len, SSL *ssl, int al ssl_cache_trusted_cert(cert); break; case OP_MAX + 4: /* skip */ - if (!allow_skip) + if (!ALLOW_SKIP) break; done = 2; SSL_set_ex_data(ssl, SkipModeExDataIndex, &SkipModeExDataIndex);