From: Richard Russon Date: Sat, 16 Feb 2019 00:35:04 +0000 (+0000) Subject: fix lgtm alerts X-Git-Tag: 2019-10-25~369^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=refs%2Fpull%2F1562%2Fhead;p=neomutt fix lgtm alerts Each of the removed tests was redundant. --- diff --git a/mutt/logging.c b/mutt/logging.c index 74760a2a3..f8c4ecb41 100644 --- a/mutt/logging.c +++ b/mutt/logging.c @@ -494,8 +494,7 @@ int log_disp_terminal(time_t stamp, const char *file, int line, if (colour > 0) ret += fprintf(fp, "\033[0m"); - if (level < 1) - ret += fprintf(fp, "\n"); + ret += fprintf(fp, "\n"); return ret; } diff --git a/muttlib.c b/muttlib.c index a5838a491..ce5370eb1 100644 --- a/muttlib.c +++ b/muttlib.c @@ -1173,7 +1173,7 @@ void mutt_expando_format(char *buf, size_t buflen, size_t col, int cols, const c col += pw; } } - else if (soft && pad < 0) + else if (soft) { int offset = ((flags & MUTT_FORMAT_ARROWCURSOR) && ArrowCursor) ? 3 : 0; int avail_cols = (cols > offset) ? (cols - offset) : 0; diff --git a/ncrypt/pgp.c b/ncrypt/pgp.c index 8ec8f0c73..a5ddce897 100644 --- a/ncrypt/pgp.c +++ b/ncrypt/pgp.c @@ -375,8 +375,7 @@ static int pgp_check_decryption_okay(FILE *fpin) if (!inside_decrypt) { mutt_debug(2, "\tPLAINTEXT encountered outside of DECRYPTION.\n"); - if (rv > -2) - rv = -2; + rv = -2; break; } } @@ -391,8 +390,7 @@ static int pgp_check_decryption_okay(FILE *fpin) /* Don't break out because we still have to check for * PLAINTEXT outside of the decryption boundaries. */ mutt_debug(2, "\tDECRYPTION_OKAY encountered.\n"); - if (rv > -2) - rv = 0; + rv = 0; } } FREE(&line); diff --git a/ncrypt/pgppacket.c b/ncrypt/pgppacket.c index 9ad9b7088..0bcf72432 100644 --- a/ncrypt/pgppacket.c +++ b/ncrypt/pgppacket.c @@ -129,7 +129,7 @@ unsigned char *pgp_read_packet(FILE *fp, size_t *len) material = b; partial = false; } - else if (192 <= b && b <= 223) + else if (b <= 223) { material = (b - 192) * 256; if (fread(&b, 1, 1, fp) < 1)