From cbec4bbf02bd8e0e2319936fd41bbcfc3ecb0243 Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Thu, 26 Nov 2009 12:05:53 +0000 Subject: [PATCH] clamp indexlist git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4734 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/command.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/src/command.cpp b/source/src/command.cpp index 9d03cff8..472df428 100644 --- a/source/src/command.cpp +++ b/source/src/command.cpp @@ -767,7 +767,12 @@ void explodelist(const char *s, vector &elems) char *indexlist(const char *s, int pos) { whitespaceskip; - loopi(pos) elementskip, whitespaceskip; + loopi(pos) + { + elementskip; + whitespaceskip; + if(!*s) break; + } const char *e = s; elementskip; if(*e=='"')