From: Wilfried Göesgens Date: Sun, 1 Aug 2010 21:32:27 +0000 (+0000) Subject: * correct token-count error detection in the iterators X-Git-Tag: v8.01~973 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=36f48a5c288e70c5e9b34a62b3a18364a86865fb * correct token-count error detection in the iterators --- 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",