Commit 9f9c835e authored by Jonathan Wilkes's avatar Jonathan Wilkes
Browse files

prevent reading uninitialized values when no args are supplied

parent a7372eeb
......@@ -165,7 +165,7 @@ static void lpt_bang(t_lpt *x)
static void *lpt_new(t_symbol *s, int argc, t_atom *argv)
{
t_lpt *x = (t_lpt *)pd_new(lpt_class);
char*devname=atom_getsymbol(argv)->s_name;
char*devname = argc ? atom_getsymbol(argv)->s_name : &s_;
if(s==gensym("lp")) {
error("lpt: the use of 'lp' has been deprecated; use 'lpt' instead");
}
......
......@@ -233,9 +233,12 @@ static void *mline_new(t_symbol* UNUSED(s), int argc, t_atom *argv)
{
t_mline *x = (t_mline *)pd_new(mline_class);
int i;
t_atom sane_default[1];
if (!argc) {
argc = 1;
SETFLOAT(sane_default, 0.);
argv = sane_default;
x->time = 0;
} else {
x->time = atom_getfloat(argv+argc-1);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment