]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common/cmdparse.cc: reduce scope of local variable 'pos'
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Mon, 24 Jun 2013 12:34:46 +0000 (14:34 +0200)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Mon, 24 Jun 2013 12:34:46 +0000 (14:34 +0200)
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/common/cmdparse.cc

index 584af054fa08477094ec6c3f60e6f818b9082c69..23e67f6de1b37e8c4b89bee9256fbe76cd5d35ee 100644 (file)
@@ -50,12 +50,11 @@ dump_cmd_to_json(JSONFormatter *f, const string& cmd)
     std::string keyval;
     std::map<std::string, std::string>desckv;
     // accumulate descriptor keywords in desckv
-    size_t pos;
 
     while (std::getline(argdesc, keyval, ',')) {
       // key=value; key by itself implies value is bool true
       // name="name" means arg dict will be titled 'name'
-      pos = keyval.find('=');
+      size_t pos = keyval.find('=');
       std::string key, val;
       if (pos != std::string::npos) {
        key = keyval.substr(0, pos);