From 92c75f90929a5c6ffa5fab05dc34bb40aad04160 Mon Sep 17 00:00:00 2001 From: rubidium Date: Mon, 4 Jan 2010 21:58:47 +0000 Subject: (svn r18727) -Fix [FS#3480]: some invalid gender/plural indices in strings, which could eventually cause crashes. --- src/strgen/strgen.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/strgen/strgen.cpp') diff --git a/src/strgen/strgen.cpp b/src/strgen/strgen.cpp index 61fcecd7b..a44644949 100644 --- a/src/strgen/strgen.cpp +++ b/src/strgen/strgen.cpp @@ -965,7 +965,11 @@ static int TranslateArgumentIdx(int argidx, int offset) } const CmdStruct *cs = _cur_pcs.cmd[argidx]; if (cs != NULL && cs->consumes <= offset) { - error("invalid argidx offset %d:%d\n", argidx, offset); + error("invalid argidx offset %d:%d", argidx, offset); + } + + if (_cur_pcs.cmd[argidx] == NULL) { + error("no command for this argidx %d", argidx); } for (int i = sum = 0; i < argidx; i++) { -- cgit v1.2.3-70-g09d2