]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
tests: use stoi() instead of atoi()
authorKefu Chai <kchai@redhat.com>
Mon, 12 Nov 2018 01:49:53 +0000 (09:49 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 15 Nov 2018 06:34:03 +0000 (14:34 +0800)
stoi() is simpler if we need to convert std::string to integer.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/test/erasure-code/ceph_erasure_code_benchmark.cc

index 7dbdf171155c7aca3f1756c541f07ab43520b05e..ccf1240fee00fa5797d53565bf1e0fa4a8cd6b56 100644 (file)
@@ -122,8 +122,8 @@ int ErasureCodeBench::setup(int argc, char** argv) {
   if (vm.count("erased") > 0)
     erased = vm["erased"].as<vector<int> >();
 
-  k = atoi(profile["k"].c_str());
-  m = atoi(profile["m"].c_str());
+  k = stoi(profile["k"]);
+  m = stoi(profile["m"]);
   
   if (k <= 0) {
     cout << "parameter k is " << k << ". But k needs to be > 0." << endl;