r8631: give an error on incorrect argument count
authorAndrew Tridgell <tridge@samba.org>
Wed, 20 Jul 2005 05:40:24 +0000 (05:40 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:29:46 +0000 (13:29 -0500)
(This used to be commit ed09e19794d9625553bc48892a2e08b84d7bdcf4)

source4/lib/appweb/ejs/ejsParser.c
source4/lib/appweb/esp/esp.h

index e7c44f4d6c62137f75b86f2e786b55d72b990638..1f110e7ac427b5b4ed335348e4abcd75482eebad 100644 (file)
@@ -2059,12 +2059,11 @@ static int evalFunction(Ejs *ep, MprVar *obj, int flags)
                formalArgs = prototype->function.args;
                argNames = (char**) formalArgs->handles;
 
-#if FUTURE
-               if (formalArgs->used != actualArgs->used) {
-                       ejsError(ep, "Bad number of args. Should be %d", formalArgs->used);
+               if (formalArgs->used > actualArgs->used) {
+                       ejsError(ep, "Bad number of args. Should be %d", 
+                                        formalArgs->used);
                        return -1;
                }
-#endif
 
                /*
                 *      Create the arguments and callee variables
index 39dc5310c21eff5938dfaf5f156e89df6835fb8c..3d9b7bf8dc55e462ba30b1af78cecab5b9d7e534 100644 (file)
@@ -103,7 +103,7 @@ typedef struct Esp {
                                int lifetime, const char *path, bool secure);
        void    (*setHeader)(EspHandle handle, const char *value, bool allowMultiple);
        void    (*setResponseCode)(EspHandle handle, int code);
-       int             (*writeBlock)(EspHandle handle, char *buf, int size);
+       int             (*writeBlock)(EspHandle handle, const char *buf, int size);
        int             (*writeFmt)(EspHandle handle, char *fmt, ...);
 #if BLD_FEATURE_MULTITHREAD
        void    (*lock)(void *lockData);