]> granicus.if.org Git - neomutt/commitdiff
initialise variables
authorRichard Russon <rich@flatcap.org>
Sat, 14 Oct 2017 16:28:18 +0000 (17:28 +0100)
committerRichard Russon <rich@flatcap.org>
Sat, 21 Oct 2017 20:13:12 +0000 (21:13 +0100)
These variables were passed uninitialised to a function which increments
them.

Discovered by Coverity after the 'if-assign' commits.

mh.c
pager.c

diff --git a/mh.c b/mh.c
index 0e2fb34a4e4830dc3c742d0ca9257cdf23c9914d..5bbd75a95b59e23b15b65f44ace159ba8c1331fa 100644 (file)
--- a/mh.c
+++ b/mh.c
@@ -585,7 +585,7 @@ static void mh_sequences_add_one(struct Context *ctx, int n, short unseen,
   char seq_flagged[STRING];
 
   char *buff = NULL;
-  int line;
+  int line = 0;
   size_t sz;
 
   if (mh_mkstemp(ctx, &nfp, &tmpfname) == -1)
diff --git a/pager.c b/pager.c
index 2f2e821cbad689e3d7d82380fc3d34c0f9c8927c..9508c9d7df024ff1e4b7bfae09ce165376b03029 100644 (file)
--- a/pager.c
+++ b/pager.c
@@ -1148,7 +1148,7 @@ static int fill_buffer(FILE *f, LOFF_T *last_pos, LOFF_T offset, unsigned char *
 {
   unsigned char *p = NULL, *q = NULL;
   static int b_read;
-  int l;
+  int l = 0;
 
   if (*buf_ready == 0)
   {