From 36f48a5c288e70c5e9b34a62b3a18364a86865fb Mon Sep 17 00:00:00 2001 From: =?utf8?q?Wilfried=20G=C3=B6esgens?= Date: Sun, 1 Aug 2010 21:32:27 +0000 Subject: [PATCH] * correct token-count error detection in the iterators --- webcit/subst.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/webcit/subst.c b/webcit/subst.c index 9ff94c57a..3721633d7 100644 --- a/webcit/subst.c +++ b/webcit/subst.c @@ -2172,11 +2172,11 @@ int preeval_iterate(WCTemplateToken *Token) Token->Preeval2 = vIt; It = (HashIterator *) vIt; - if (TP->Tokens->nParameters <= It->AdditionalParams + 2) { + if (TP->Tokens->nParameters < It->AdditionalParams + 2) { LogTemplateError( NULL, "Iterator", ERR_PARM1, TP, "doesn't work with %d params", - TP->Tokens->nParameters - 1); + TP->Tokens->nParameters); } @@ -2212,7 +2212,7 @@ void tmpl_iterate_subtmpl(StrBuf *Target, WCTemplputParams *TP) return; } - if (TP->Tokens->nParameters <= It->AdditionalParams + 2) { + if (TP->Tokens->nParameters < It->AdditionalParams + 2) { LogTemplateError( Target, "Iterator", ERR_PARM1, TP, "doesn't work with %d params", -- 2.30.2