Salome HOME
- Bug in check time duration
authorribes <ribes>
Mon, 25 Jan 2010 14:35:13 +0000 (14:35 +0000)
committerribes <ribes>
Mon, 25 Jan 2010 14:35:13 +0000 (14:35 +0000)
src/Launcher/Launcher_Job.cxx

index d8538594a921fbc932512a7d827140088a6ce2b6..51f5d18cd7f253a0a130807b136dfc19efb7e52c 100644 (file)
@@ -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);