mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Bugfix: do not substr() on too small strings.
This commit is contained in:
parent
dedbe78cee
commit
ea0abd1331
@ -39,7 +39,7 @@ setupPropertyTree(FlowLinearSolverParameters p) // Note: copying the parameters
|
||||
std::string conf = p.linsolver_;
|
||||
|
||||
// Get configuration from file.
|
||||
if (conf.substr(conf.size() - 5, 5) == ".json") {
|
||||
if (conf.size() > 5 && conf.substr(conf.size() - 5, 5) == ".json") { // the ends_with() method is not available until C++20
|
||||
#if BOOST_VERSION / 100 % 1000 > 48
|
||||
try {
|
||||
boost::property_tree::ptree prm;
|
||||
|
Loading…
Reference in New Issue
Block a user