Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Oops, it's stoi() for integers.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 4 May 2022 06:12:55 +0000 (08:12 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 4 May 2022 06:12:55 +0000 (08:12 +0200)
examples/cpp/dht-chord/s4u-dht-chord.cpp

index 9bdf823..313d933 100644 (file)
@@ -22,10 +22,10 @@ int main(int argc, char* argv[])
   std::string deployment_file(argv[argc - 1]);
   for (const auto& option : std::vector<std::string>(argv + 1, argv + argc - 2)) {
     if (option.rfind("-nb_bits=", 0) == 0) {
-      nb_bits = std::stod(option.substr(option.find('=') + 1));
+      nb_bits = std::stoi(option.substr(option.find('=') + 1));
       XBT_DEBUG("Set nb_bits to %d", nb_bits);
     } else if (option.rfind("-timeout=", 0) == 0) {
-      timeout = std::stod(option.substr(option.find('=') + 1));
+      timeout = std::stoi(option.substr(option.find('=') + 1));
       XBT_DEBUG("Set timeout to %d", timeout);
     } else {
       xbt_die("Invalid chord option '%s'", option.c_str());