From 6bc219a0b403d086340c6cb39d25681702d0c92d Mon Sep 17 00:00:00 2001 From: ribes Date: Mon, 25 Jan 2010 14:35:13 +0000 Subject: [PATCH] - Bug in check time duration --- src/Launcher/Launcher_Job.cxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Launcher/Launcher_Job.cxx b/src/Launcher/Launcher_Job.cxx index d8538594a..51f5d18cd 100644 --- a/src/Launcher/Launcher_Job.cxx +++ b/src/Launcher/Launcher_Job.cxx @@ -284,10 +284,12 @@ Launcher::Job::checkMaximumDuration(const std::string & maximum_duration) { std::string result(""); std::string edt_value = maximum_duration; + std::size_t pos = edt_value.find(":"); + if (edt_value != "") { - std::string begin_edt_value = edt_value.substr(0, 2); - std::string mid_edt_value = edt_value.substr(2, 1); - std::string end_edt_value = edt_value.substr(3); + std::string begin_edt_value = edt_value.substr(0, pos); + std::string mid_edt_value = edt_value.substr(pos, 1); + std::string end_edt_value = edt_value.substr(pos + 1, edt_value.npos); long value; std::istringstream iss(begin_edt_value); -- 2.39.2