unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: "Jeffrey C. Ollie" <jeff@ocjtech.us>
To: Not Much Mail <notmuch@notmuchmail.org>
Subject: [PATCH] Silence compiler warning by initializing a variable.
Date: Wed, 25 Nov 2009 07:01:36 -0600	[thread overview]
Message-ID: <1259154096-14856-1-git-send-email-jeff@ocjtech.us> (raw)

If Xapian threw an exception on notmuch_query_count_messages the count
variable could be used uninitialized.  Initialize count to solve the
problem.

Signed-off-by: Jeffrey C. Ollie <jeff@ocjtech.us>
---
 lib/query.cc |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/query.cc b/lib/query.cc
index a571a61..9106b92 100644
--- a/lib/query.cc
+++ b/lib/query.cc
@@ -315,7 +315,7 @@ notmuch_query_count_messages (notmuch_query_t *query)
 {
     notmuch_database_t *notmuch = query->notmuch;
     const char *query_string = query->query_string;
-    Xapian::doccount count;
+    Xapian::doccount count = 0;
 
     try {
 	Xapian::Enquire enquire (*notmuch->xapian_db);
-- 
1.6.5.2

             reply	other threads:[~2009-11-25 13:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-25 13:01 Jeffrey C. Ollie [this message]
2009-11-28  2:38 ` [PATCH] Silence compiler warning by initializing a variable Carl Worth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1259154096-14856-1-git-send-email-jeff@ocjtech.us \
    --to=jeff@ocjtech.us \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).