Update of /cvsroot/pure-data/externals/zexy/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14416
Modified Files: minmax.c Log Message: bugfix: [minmax] used to crash when an empty-list (not a bang) was sent to its left inlet
Index: minmax.c =================================================================== RCS file: /cvsroot/pure-data/externals/zexy/src/minmax.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** minmax.c 25 Jan 2006 16:27:08 -0000 1.3 --- minmax.c 26 Mar 2006 19:14:25 -0000 1.4 *************** *** 38,54 **** static void minmax_list(t_minmax *x, t_symbol *s, int argc, t_atom *argv) { ! t_float min = atom_getfloat(argv++); ! t_float max=min; ! argc--; ! ! while(argc--){ ! t_float f = atom_getfloat(argv++); ! if (f<min)min=f; ! else if (f>max)max=f; } - - x->min=min; - x->max=max; - minmax_bang(x); } --- 38,55 ---- static void minmax_list(t_minmax *x, t_symbol *s, int argc, t_atom *argv) { ! if(argc){ ! t_float min = atom_getfloat(argv++); ! t_float max=min; ! argc--; ! ! while(argc--){ ! t_float f = atom_getfloat(argv++); ! if (f<min)min=f; ! else if (f>max)max=f; ! } ! ! x->min=min; ! x->max=max; } minmax_bang(x); }