[icinga-checkins] icinga.org: icinga2/master: Fix uninitialized variables.

git at icinga.org git at icinga.org
Fri May 3 12:44:35 CEST 2013


Module: icinga2
Branch: master
Commit: 1d6e1c205f5abf4c686b1885217179f197479ab2
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=1d6e1c205f5abf4c686b1885217179f197479ab2

Author: Gunnar Beutner <gunnar.beutner at netways.de>
Date:   Fri May  3 12:44:27 2013 +0200

Fix uninitialized variables.

---

 lib/icinga/legacytimeperiod.cpp |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/icinga/legacytimeperiod.cpp b/lib/icinga/legacytimeperiod.cpp
index 8fc8e6b..8c49a30 100644
--- a/lib/icinga/legacytimeperiod.cpp
+++ b/lib/icinga/legacytimeperiod.cpp
@@ -159,7 +159,7 @@ void LegacyTimePeriod::ParseTimeSpec(const String& timespec, tm *begin, tm *end,
 	std::vector<String> tokens;
 	boost::algorithm::split(tokens, timespec, boost::is_any_of(" "));
 
-	int mon;
+	int mon = -1;
 
 	if (tokens.size() > 1 && (tokens[0] == "day" || (mon = MonthFromString(tokens[0])) != -1)) {
 		if (mon == -1)
@@ -214,7 +214,7 @@ void LegacyTimePeriod::ParseTimeSpec(const String& timespec, tm *begin, tm *end,
 			myref.tm_mon = mon;
 		}
 
-		int n;
+		int n = 0;
 
 		if (tokens.size() > 1)
 			n = Convert::ToLong(tokens[1]);





More information about the icinga-checkins mailing list