Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13043
Modified Files: Tag: devel_0_39 desire.c Log Message: protect canvas_connect
Index: desire.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.c,v retrieving revision 1.1.2.190 retrieving revision 1.1.2.191 diff -C2 -d -r1.1.2.190 -r1.1.2.191 *** desire.c 17 Nov 2006 04:11:17 -0000 1.1.2.190 --- desire.c 17 Nov 2006 05:03:57 -0000 1.1.2.191 *************** *** 1421,1431 **** return pd_class((t_pd *)x)==text_class && x->te_type==T_OBJECT;}
! void canvas_connect(t_canvas *x, t_floatarg fwhoout, t_floatarg foutlet, t_floatarg fwhoin,t_floatarg finlet) { ! int i, ifrom=(int)fwhoout, outlet=(int)foutlet, ito=(int)fwhoin, inlet=(int)finlet; t_gobj *gfrom=0, *gto=0; ! t_object *from, *to; t_outconnect *oc; ! for (i=ifrom, gfrom=x->list; i; gfrom=gfrom->g_next, i--) if (!gfrom->g_next) goto bad; ! for (i=ito, gto =x->list; i; gto =gto ->g_next, i--) if (!gto ->g_next) goto bad; from = pd_checkobject((t_pd *)gfrom); to = pd_checkobject( (t_pd *)gto); --- 1421,1433 ---- return pd_class((t_pd *)x)==text_class && x->te_type==T_OBJECT;}
! void canvas_connect(t_canvas *x, t_floatarg ffrom, t_floatarg foutlet, t_floatarg fto,t_floatarg finlet) { ! int i, ifrom=(int)ffrom, outlet=(int)foutlet, ito=(int)fto, inlet=(int)finlet; t_gobj *gfrom=0, *gto=0; ! t_object *from=0, *to=0; t_outconnect *oc; ! if (ifrom<0) goto bad; ! if (ito <0) goto bad; ! for (i=ifrom, gfrom=x->list; i>0; gfrom=gfrom->g_next, i--) if (!gfrom->g_next) goto bad; ! for (i=ito, gto =x->list; i>0; gto =gto ->g_next, i--) if (!gto ->g_next) goto bad; from = pd_checkobject((t_pd *)gfrom); to = pd_checkobject( (t_pd *)gto); *************** *** 1439,1443 **** return; bad: ! post("%s %d %d %d %d (%s->%s) connection failed", x->name->s_name, from,outlet,to,inlet, from ? class_getname(pd_class((t_pd *)from)) : "???", to ? class_getname(pd_class((t_pd *)to )) : "???"); --- 1441,1445 ---- return; bad: ! post("%s %d %d %d %d (%s->%s) connection failed", x->name->s_name,ifrom,outlet,ito,inlet, from ? class_getname(pd_class((t_pd *)from)) : "???", to ? class_getname(pd_class((t_pd *)to )) : "???");