From 7439486bc63269445ef6f69eff6d2072b06bc0aa Mon Sep 17 00:00:00 2001 From: ps Date: Fri, 30 Sep 2011 07:59:05 +0000 Subject: [PATCH] initialize spamcount in case cleandb fails --- src/hermes.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hermes.cpp b/src/hermes.cpp index 712b5a4..5af8c45 100644 --- a/src/hermes.cpp +++ b/src/hermes.cpp @@ -288,7 +288,7 @@ void *cleaner_thread_run(void *) sched_yield(); if(now>next_run) { - unsigned long spamcount; + unsigned long spamcount=0; next_run=now+3600; //if we just add 3600 like before, then if //time changes during execution of hermes this will run @@ -298,12 +298,12 @@ void *cleaner_thread_run(void *) try { spamcount=db.cleanDB(); + LDEB("Cleaning database, cleaning "+Utils::inttostr(spamcount)+" blocked spams."); } catch(Exception &e) { LERR("Error cleaning the database: " + string(e)); } - LDEB("Cleaning database, cleaning "+Utils::inttostr(spamcount)+" blocked spams."); if(spamcount>0&&cfg.getSubmitStats()) { try