]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
prevent from having negative index
authorCédric Aguerre <cedric.aguerre@edf.fr>
Wed, 28 Oct 2015 16:16:36 +0000 (17:16 +0100)
committerCédric Aguerre <cedric.aguerre@edf.fr>
Wed, 28 Oct 2015 16:16:36 +0000 (17:16 +0100)
src/PyInterp/PyInterp_Interp.cxx

index 4461c75c49189a197d584ca6399e7122f7fdc48e..f2c286d43ab2f8f23bc9f582492bf03e7f553906 100644 (file)
@@ -450,7 +450,7 @@ static int compile_command(const char *command, PyObject * global_ctxt, PyObject
   std::string singleCommand = command;
   std::string commandArgs = "";
 
-  while (singleCommand.at(singleCommand.size()-1) == '\n')
+  while (singleCommand.size() > 0 && singleCommand.at(singleCommand.size()-1) == '\n')
     singleCommand.erase(singleCommand.size()-1);
   std::size_t pos = singleCommand.find("args:");
   if (pos != std::string::npos) {