From 1d6e1c205f5abf4c686b1885217179f197479ab2 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Fri, 3 May 2013 12:44:27 +0200 Subject: [PATCH] Fix uninitialized variables. --- lib/icinga/legacytimeperiod.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/icinga/legacytimeperiod.cpp b/lib/icinga/legacytimeperiod.cpp index 8fc8e6b8f..8c49a308b 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 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]);