[Gridflow-cvs] [svn] commit: r6215 - /trunk/src/classes2.cxx

svn-gridflow at artengine.ca svn-gridflow at artengine.ca
Tue Sep 7 20:42:33 EDT 2010


Author: matju
Date: Tue Sep  7 20:42:31 2010
New Revision: 6215

Log:
[args]: don't crash when wanting no args but got some

Modified:
    trunk/src/classes2.cxx

Modified: trunk/src/classes2.cxx
==============================================================================
--- trunk/src/classes2.cxx (original)
+++ trunk/src/classes2.cxx Tue Sep  7 20:42:31 2010
@@ -131,13 +131,13 @@
 		} else v = (t_atom2 *)&argv[i];
 		if (sargs[i].name==wildcard) {
 			if (argc-i>0) out[i](argc-i,argv+i); else out[i]();
+			return;
 		} else {
 			if (v->a_type==A_LIST) {t_binbuf *b = *v; out[i](binbuf_getnatom(b),binbuf_getvec(b));}
 			else                                      out[i](*v);
 		}
 	}
-	if (argc>int(sargs.size()) && sargs[sargs.size()-1].name!=wildcard)
-		pd_error(canvas,"warning: too many args (got %d, want %d)", argc, int(sargs.size()));
+	if (argc>int(sargs.size())) pd_error(canvas,"warning: too many args (got %d, want %d)", argc, int(sargs.size()));
 }
 \end class {install("args",1,1);}
 



More information about the Gridflow-cvs mailing list