From 7fa95f110b21f884c837f2944de074a7a72ecd53 Mon Sep 17 00:00:00 2001 From: Richard Russon Date: Sat, 16 Feb 2019 00:35:04 +0000 Subject: [PATCH] fix lgtm alerts Each of the removed tests was redundant. --- mutt/logging.c | 3 +-- muttlib.c | 2 +- ncrypt/pgp.c | 6 ++---- ncrypt/pgppacket.c | 2 +- 4 files changed, 5 insertions(+), 8 deletions(-) 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) -- 2.50.1