From 8ccf80cbf3b703edfad3176465c6383af0b74b81 Mon Sep 17 00:00:00 2001 From: Marcin Siodelski Date: Fri, 6 Mar 2015 20:18:42 +0100 Subject: [PATCH] [3736] Fixed cppcheck variableScope error in perfdhcp. --- src/bin/perfdhcp/command_options.cc | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/bin/perfdhcp/command_options.cc b/src/bin/perfdhcp/command_options.cc index 94eb265b60..6df64052d5 100644 --- a/src/bin/perfdhcp/command_options.cc +++ b/src/bin/perfdhcp/command_options.cc @@ -526,13 +526,12 @@ CommandOptions::initClientsNum() { const std::string errmsg = "value of -R 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(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(optarg); check(clients_num < 0, errmsg); clients_num_ = boost::lexical_cast(optarg); } catch (boost::bad_lexical_cast&) { -- 2.47.2