]> granicus.if.org Git - neomutt/commitdiff
fix redundant code
authorRichard Russon <rich@flatcap.org>
Wed, 21 Feb 2018 01:22:21 +0000 (01:22 +0000)
committerRichard Russon <rich@flatcap.org>
Wed, 21 Feb 2018 01:22:21 +0000 (01:22 +0000)
mutt/mime.h
mutt/rfc2047.c
ncrypt/crypt_gpgme.c
recvattach.c
rfc3676.c

index 598e20a239e87d1b8c59e2f309e346980193d92c..12e2aa1bda5cacf5dc6392ac7cfdbc386e3e20fe 100644 (file)
@@ -74,10 +74,10 @@ extern const char MimeSpecials[];
 
 #define hexval(c) IndexHex[(unsigned int) (c)]
 
-#define is_multipart(x)                                                        \
-  ((x)->type == TYPEMULTIPART ||                                               \
-   ((x)->type == TYPEMESSAGE && ((strcasecmp((x)->subtype, "rfc822") == 0) ||  \
-                                 (strcasecmp((x)->subtype, "news") == 0))))
+#define is_multipart(x)                                                             \
+  (((x)->type == TYPEMULTIPART) || (((x)->type == TYPEMESSAGE) && ((x)->subtype) && \
+                                    ((strcasecmp((x)->subtype, "rfc822") == 0) ||   \
+                                     (strcasecmp((x)->subtype, "news") == 0))))
 
 #define TYPE(X)                                                                \
   ((X->type == TYPEOTHER) && (X->xtype != NULL) ? X->xtype : BodyTypes[(X->type)])
index af915f37cd6bda4ed4ec1fb5dde97f1aa7f92660..2e02c7ffd34995458fc1f699417834727ae7212f 100644 (file)
@@ -442,7 +442,7 @@ static int rfc2047_encode(const char *d, size_t dlen, int col, const char *fromc
   size_t bufpos, buflen;
   char *u = NULL, *t0 = NULL, *t1 = NULL, *t = NULL;
   char *s0 = NULL, *s1 = NULL;
-  size_t ulen, r, n, wlen;
+  size_t ulen, r, n, wlen = 0;
   encoder_t encoder;
   char *tocode1 = NULL;
   const char *tocode = NULL;
index 1fc8560b46f2eb5824cb1c1ed7e700b41dec117a..051ccee4fd40f9b85733a2b9da974470f2187a1d 100644 (file)
@@ -2577,9 +2577,7 @@ int pgp_gpgme_application_handler(struct Body *m, struct State *s)
           if (gpg_err_code(err) == GPG_ERR_NO_DATA)
           {
             /* Decrypt verify can't handle signed only messages. */
-            err = (gpgme_data_seek(armored_data, 0, SEEK_SET) == -1) ?
-                      gpgme_error_from_errno(errno) :
-                      0;
+            gpgme_data_seek(armored_data, 0, SEEK_SET);
             /* Must release plaintext so that we supply an
                          uninitialized object. */
             gpgme_data_release(plaintext);
index 7303e3f5c151540ba2dc93cec8007a8e94426330..c066a2ad17844249399acbcc2e34f3b76069b706 100644 (file)
@@ -826,7 +826,7 @@ static void print_attachment_list(struct AttachCtx *actx, FILE *fp, bool tag,
 
 void mutt_print_attachment_list(struct AttachCtx *actx, FILE *fp, bool tag, struct Body *top)
 {
-  struct State state;
+  struct State state = { 0 };
 
   pid_t thepid;
   if (query_quadoption(Print,
@@ -839,7 +839,6 @@ void mutt_print_attachment_list(struct AttachCtx *actx, FILE *fp, bool tag, stru
     if (!can_print(actx, top, tag))
       return;
     mutt_endwin(NULL);
-    memset(&state, 0, sizeof(struct State));
     thepid = mutt_create_filter(NONULL(PrintCommand), &state.fpout, NULL, NULL);
     print_attachment_list(actx, fp, tag, top, &state);
     mutt_file_fclose(&state.fpout);
index 67d716dfd27fd3fe46e713fb9094f00bf57607e3..4a72a8a72de408eb32e0741ecaac7d6744ab65de 100644 (file)
--- a/rfc3676.c
+++ b/rfc3676.c
@@ -202,7 +202,7 @@ static void print_flowed_line(char *line, struct State *s, int ql,
   mutt_debug(4, "f=f: line [%s], width = %ld, spaces = %lu\n", line,
              (long) width, fst->spaces);
 
-  for (p = (char *) line, words = 0; (p = strsep(&line, " ")) != NULL;)
+  for (words = 0; (p = strsep(&line, " "));)
   {
     mutt_debug(4, "f=f: word [%s], width: %lu, remaining = [%s]\n", p, fst->width, line);