]> granicus.if.org Git - neomutt/commitdiff
fix lgtm alerts 1562/head
authorRichard Russon <rich@flatcap.org>
Sat, 16 Feb 2019 00:35:04 +0000 (00:35 +0000)
committerRichard Russon <rich@flatcap.org>
Sat, 16 Feb 2019 14:53:12 +0000 (14:53 +0000)
Each of the removed tests was redundant.

mutt/logging.c
muttlib.c
ncrypt/pgp.c
ncrypt/pgppacket.c

index 74760a2a38e6eb578ddd007be6fb938b71837a6b..f8c4ecb4181206f05d9bccf118b052f46508ddd8 100644 (file)
@@ -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;
 }
index a5838a4913a25bc70e84f97d1f7903800eecbd2e..ce5370eb1ab1bb5201c17ae834ead1025fac8599 100644 (file)
--- 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;
index 8ec8f0c732d3661a752902adb72d5b5902854873..a5ddce897f188ab52db6a60916a41cc08f6969b2 100644 (file)
@@ -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);
index 9ad9b7088dad385aed5b66d768e83155f108c75e..0bcf724324098d1c924bedced1c42f6de4fd678c 100644 (file)
@@ -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)