From: Cédric Aguerre Date: Wed, 28 Oct 2015 16:16:36 +0000 (+0100) Subject: prevent from having negative index X-Git-Tag: V8_0_pre~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ceb965be050853aa13700cf55b9aa48237aa5470;p=modules%2Fgui.git prevent from having negative index --- diff --git a/src/PyInterp/PyInterp_Interp.cxx b/src/PyInterp/PyInterp_Interp.cxx index 4461c75c4..f2c286d43 100644 --- a/src/PyInterp/PyInterp_Interp.cxx +++ b/src/PyInterp/PyInterp_Interp.cxx @@ -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) {