diff --git a/components/core/src/clp_s/Utils.cpp b/components/core/src/clp_s/Utils.cpp index b4c7a1cb4..56cf125eb 100644 --- a/components/core/src/clp_s/Utils.cpp +++ b/components/core/src/clp_s/Utils.cpp @@ -1,5 +1,7 @@ #include "Utils.hpp" +#include +#include #include #include #include @@ -87,10 +89,11 @@ bool is_multi_file_archive(std::string_view const path) { { continue; } else { - try { - auto segment_file_number = std::stoi(file_name); - continue; - } catch (std::exception const& e) { + uint64_t segment_file_number{}; + auto const* begin = file_name.data(); + auto const* end = file_name.data() + file_name.size(); + auto [last, rc] = std::from_chars(begin, end, segment_file_number); + if (std::errc{} != rc || last != end) { return false; } }