Browse Source

[2726] Initialize variables

Michal 'vorner' Vaner 12 years ago
parent
commit
a9d957c18a
2 changed files with 6 additions and 5 deletions
  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();
     const string::const_iterator end = ttlstr.end();
     string::const_iterator pos = ttlstr.begin();
     string::const_iterator pos = ttlstr.begin();
 
 
-    // When we detect we have some units
-    bool units_mode = false;
-
     try {
     try {
+
+        // When we detect we have some units
+        bool units_mode = false;
+
         while (pos != end) {
         while (pos != end) {
             // Find the first unit, if there's any.
             // Find the first unit, if there's any.
             const string::const_iterator unit = find_if(pos, end, myIsalpha);
             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).
     /// \param lineno Line number on which error occurred (if > 0).
     MessageException(const char* file, size_t line, const char* what,
     MessageException(const char* file, size_t line, const char* what,
                      MessageID id, const std::string& arg1, int lineno)
                      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) {
         if (lineno > 0) {
             args_.push_back(boost::lexical_cast<std::string>(lineno));
             args_.push_back(boost::lexical_cast<std::string>(lineno));
@@ -82,7 +82,7 @@ public:
     MessageException(const char* file, size_t line, const char *what,
     MessageException(const char* file, size_t line, const char *what,
                      MessageID id, const std::string& arg1,
                      MessageID id, const std::string& arg1,
                      const std::string& arg2, int lineno)
                      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) {
         if (lineno > 0) {
             args_.push_back(boost::lexical_cast<std::string>(lineno));
             args_.push_back(boost::lexical_cast<std::string>(lineno));