cppcheck: misc
authorRichard Russon <rich@flatcap.org>
Tue, 3 Apr 2018 13:00:25 +0000 (14:00 +0100)
committerRichard Russon <rich@flatcap.org>
Tue, 3 Apr 2018 13:00:25 +0000 (14:00 +0100)
buffy.c
imap/auth_sasl.c
newsrc.c
send.c

diff --git a/buffy.c b/buffy.c
index 73276f141dcaa2e831fdaef1857fd979fd0cba20..8bad1fa0318a439a0583c0e8f23dfa9f492b68b1 100644 (file)
--- a/buffy.c
+++ b/buffy.c
@@ -353,7 +353,7 @@ static void buffy_check(struct Buffy *tmp, struct stat *contex_sb, bool check_st
   int orig_count, orig_unread, orig_flagged;
 #endif
 
-  sb.st_size = 0;
+  memset(&sb, 0, sizeof (sb));
 
 #ifdef USE_SIDEBAR
   orig_new = tmp->new;
@@ -664,7 +664,7 @@ int mutt_parse_unmailboxes(struct Buffer *path, struct Buffer *s,
       /* Decide whether to delete all normal mailboxes or all virtual */
       bool virt = (((*b)->magic == MUTT_NOTMUCH) && (data & MUTT_VIRTUAL));
       bool norm = (((*b)->magic != MUTT_NOTMUCH) && !(data & MUTT_VIRTUAL));
-      bool clear_this = clear_all && (virt | norm);
+      bool clear_this = clear_all && (virt || norm);
 
       if (clear_this || (mutt_str_strcasecmp(buf, (*b)->path) == 0) ||
           (mutt_str_strcasecmp(buf, (*b)->desc) == 0))
index 624f6e87c8d6dc465af7d3d9e617b3d0cfc1836b..71a8fc86b1f7de2099c465fd22857ec222931609 100644 (file)
@@ -57,7 +57,7 @@ enum ImapAuthRes imap_auth_sasl(struct ImapData *idata, const char *method)
   size_t bufsize = 0;
   const char *mech = NULL;
   const char *pc = NULL;
-  unsigned int len = 0, olen;
+  unsigned int len = 0, olen = 0;
   bool client_start;
 
   if (mutt_sasl_client_new(idata->conn, &saslconn) < 0)
index 1aed7228841049662d049226a01faffb2c89bace..f975345111593f8a55bcd9a6fd46b881acf1e8e5 100644 (file)
--- a/newsrc.c
+++ b/newsrc.c
@@ -691,7 +691,7 @@ void nntp_hcache_update(struct NntpData *nntp_data, header_cache_t *hc)
   char buf[16];
   bool old = false;
   void *hdata = NULL;
-  anum_t first, last;
+  anum_t first = 0, last = 0;
 
   if (!hc)
     return;
diff --git a/send.c b/send.c
index 9b9d7fcf6960b85a382e6ac71e2130644ffa9a27..0a560ecbe93439d72ecca4df98ece7e88a351fba 100644 (file)
--- a/send.c
+++ b/send.c
@@ -899,7 +899,7 @@ static int generate_body(FILE *tempfp, struct Header *msg, int flags,
         }
       }
     }
-    else if (i == -1)
+    else
       return -1;
   }
   /* if (WithCrypto && (flags & SENDKEY)) */