unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] Silence compiler warning by initializing a variable.
@ 2009-11-25 13:01 Jeffrey C. Ollie
  2009-11-28  2:38 ` Carl Worth
  0 siblings, 1 reply; 2+ messages in thread
From: Jeffrey C. Ollie @ 2009-11-25 13:01 UTC (permalink / raw)
  To: Not Much Mail

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Silence compiler warning by initializing a variable.
  2009-11-25 13:01 [PATCH] Silence compiler warning by initializing a variable Jeffrey C. Ollie
@ 2009-11-28  2:38 ` Carl Worth
  0 siblings, 0 replies; 2+ messages in thread
From: Carl Worth @ 2009-11-28  2:38 UTC (permalink / raw)
  To: Jeffrey C. Ollie, Not Much Mail

On Wed, 25 Nov 2009 07:01:36 -0600, "Jeffrey C. Ollie" <jeff@ocjtech.us> wrote:
> If Xapian threw an exception on notmuch_query_count_messages the count
> variable could be used uninitialized.  Initialize count to solve the
> problem.

Thanks for the fix. This is pushed.

-Carl

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-11-28  2:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-25 13:01 [PATCH] Silence compiler warning by initializing a variable Jeffrey C. Ollie
2009-11-28  2:38 ` Carl Worth

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).