* correct token-count error detection in the iterators
authorWilfried Göesgens <willi@citadel.org>
Sun, 1 Aug 2010 21:32:27 +0000 (21:32 +0000)
committerWilfried Göesgens <willi@citadel.org>
Sun, 1 Aug 2010 21:32:27 +0000 (21:32 +0000)
webcit/subst.c

index 9ff94c57a4941e8a6d4bd59484016f11deb2f6e9..3721633d73239ebe5608ae4e6dc59644e8c398db 100644 (file)
@@ -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",