From 5b126d345c2a13c1fc58e47ff906099fd416c743 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Sun, 26 Mar 2006 19:14:25 +0000 Subject: bugfix: [minmax] used to crash when an empty-list (not a bang) was sent to its left inlet svn path=/trunk/externals/zexy/; revision=4771 --- src/minmax.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/minmax.c b/src/minmax.c index f96b025..c44065d 100644 --- a/src/minmax.c +++ b/src/minmax.c @@ -37,19 +37,20 @@ static void minmax_bang(t_minmax *x) 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 (fmax)max=f; + if(argc){ + t_float min = atom_getfloat(argv++); + t_float max=min; + argc--; + + while(argc--){ + t_float f = atom_getfloat(argv++); + if (fmax)max=f; + } + + x->min=min; + x->max=max; } - - x->min=min; - x->max=max; - minmax_bang(x); } -- cgit v1.2.1