X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/093591688e3facd6c1421b8072a66c9d343a0ad1..9304dfd37fe98984bb8b1ae13a107438ed44189f:/src/smpi/internals/smpi_global.cpp diff --git a/src/smpi/internals/smpi_global.cpp b/src/smpi/internals/smpi_global.cpp index 749fd2f046..ce1c397f4e 100644 --- a/src/smpi/internals/smpi_global.cpp +++ b/src/smpi/internals/smpi_global.cpp @@ -473,9 +473,7 @@ static void smpi_init_privatization_dlopen(const std::string& executable) // Copy the dynamic library, the new name must be the same length as the old one // just replace the name with 7 digits for the rank and the rest of the name. - unsigned int pad = 7; - if (libname.length() < pad) - pad = libname.length(); + auto pad = std::min(7, libname.length()); std::string target_libname = std::string(pad - std::to_string(rank).length(), '0') + std::to_string(rank) + libname.substr(pad); std::string target_lib = simgrid::config::get_value("smpi/tmpdir") + "/" + target_libname; target_libs.push_back(target_lib);