]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[3736] Fixed cppcheck variableScope error in perfdhcp.
authorMarcin Siodelski <marcin@isc.org>
Fri, 6 Mar 2015 19:18:42 +0000 (20:18 +0100)
committerMarcin Siodelski <marcin@isc.org>
Fri, 6 Mar 2015 19:18:42 +0000 (20:18 +0100)
src/bin/perfdhcp/command_options.cc

index 94eb265b604f40914e16e947f4146a4a5ea42a21..6df64052d5ca1ce487e69dfbab16753c3f84ead9 100644 (file)
@@ -526,13 +526,12 @@ CommandOptions::initClientsNum() {
     const std::string errmsg =
         "value of -R <value> must be non-negative integer";
 
-    // Declare clients_num as as 64-bit signed value to
-    // be able to detect negative values provided
-    // by user. We would not detect negative values
-    // if we casted directly to unsigned value.
-    long long clients_num = 0;
     try {
-        clients_num = boost::lexical_cast<long long>(optarg);
+        // Declare clients_num as as 64-bit signed value to
+        // be able to detect negative values provided
+        // by user. We would not detect negative values
+        // if we casted directly to unsigned value.
+        long long clients_num = boost::lexical_cast<long long>(optarg);
         check(clients_num < 0, errmsg);
         clients_num_ = boost::lexical_cast<uint32_t>(optarg);
     } catch (boost::bad_lexical_cast&) {