]> git.mxchange.org Git - simgear.git/commitdiff
Melchior discovered that call(call) would crash due to a longstanding bug with argume...
authorandy <andy>
Wed, 1 Aug 2007 22:46:12 +0000 (22:46 +0000)
committerandy <andy>
Wed, 1 Aug 2007 22:46:12 +0000 (22:46 +0000)
simgear/nasal/lib.c

index a724d5cb0bb20a11954dcb4a3223a6f21119637d..f7ce44e4466e9aaf8ac7b3e48361a0791155549f 100644 (file)
@@ -224,7 +224,7 @@ static naRef f_call(naContext c, naRef me, int argc, naRef* args)
     callns = argc > 3 ? args[3] : naNil(); // ditto
     if(!IS_HASH(callme)) callme = naNil();
     if(!IS_HASH(callns)) callns = naNil();
-    if(!IS_FUNC(args[0]) || (!IS_NIL(callargs) && !IS_VEC(callargs)))
+    if(argc==0 || !IS_FUNC(args[0]) || (!IS_NIL(callargs) && !IS_VEC(callargs)))
         ARGERR();
 
     subc = naSubContext(c);