From ceb965be050853aa13700cf55b9aa48237aa5470 Mon Sep 17 00:00:00 2001 From: =?utf8?q?C=C3=A9dric=20Aguerre?= Date: Wed, 28 Oct 2015 17:16:36 +0100 Subject: [PATCH] prevent from having negative index --- src/PyInterp/PyInterp_Interp.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) { -- 2.39.2