]> granicus.if.org Git - icinga2/commitdiff
Fix uninitialized variables.
authorGunnar Beutner <gunnar.beutner@netways.de>
Fri, 3 May 2013 10:44:27 +0000 (12:44 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Fri, 3 May 2013 10:44:27 +0000 (12:44 +0200)
lib/icinga/legacytimeperiod.cpp

index 8fc8e6b8f9373210f256198c236eda0cc6263406..8c49a308b669292c12fc55531ca415a90422ba15 100644 (file)
@@ -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]);