Parcourir la source

[2726] Initialize variables

Michal 'vorner' Vaner il y a 12 ans
Parent
commit
a9d957c18a
2 fichiers modifiés avec 6 ajouts et 5 suppressions
  1. 4 3
      src/lib/dns/rrttl.cc
  2. 2 2
      src/lib/log/message_exception.h

+ 4 - 3
src/lib/dns/rrttl.cc

@@ -74,10 +74,11 @@ parseTTLString(const string& ttlstr, uint32_t& ttlval, string* error_txt) {
     const string::const_iterator end = ttlstr.end();
     string::const_iterator pos = ttlstr.begin();
 
-    // When we detect we have some units
-    bool units_mode = false;
-
     try {
+
+        // When we detect we have some units
+        bool units_mode = false;
+
         while (pos != end) {
             // Find the first unit, if there's any.
             const string::const_iterator unit = find_if(pos, end, myIsalpha);

+ 2 - 2
src/lib/log/message_exception.h

@@ -62,7 +62,7 @@ public:
     /// \param lineno Line number on which error occurred (if > 0).
     MessageException(const char* file, size_t line, const char* what,
                      MessageID id, const std::string& arg1, int lineno)
-        : isc::Exception(file, line, what), id_(id)
+        : isc::Exception(file, line, what), id_(id), lineno_(lineno)
     {
         if (lineno > 0) {
             args_.push_back(boost::lexical_cast<std::string>(lineno));
@@ -82,7 +82,7 @@ public:
     MessageException(const char* file, size_t line, const char *what,
                      MessageID id, const std::string& arg1,
                      const std::string& arg2, int lineno)
-        : isc::Exception(file, line, what), id_(id)
+        : isc::Exception(file, line, what), id_(id), lineno_(lineno)
     {
         if (lineno > 0) {
             args_.push_back(boost::lexical_cast<std::string>(lineno));