Skip to content
Snippets Groups Projects
Commit 9f9c835e authored by Jonathan Wilkes's avatar Jonathan Wilkes
Browse files

prevent reading uninitialized values when no args are supplied

parent a7372eeb
No related branches found
No related tags found
2 merge requests!114External tests,!113WIP: External tests revised
...@@ -165,7 +165,7 @@ static void lpt_bang(t_lpt *x) ...@@ -165,7 +165,7 @@ static void lpt_bang(t_lpt *x)
static void *lpt_new(t_symbol *s, int argc, t_atom *argv) static void *lpt_new(t_symbol *s, int argc, t_atom *argv)
{ {
t_lpt *x = (t_lpt *)pd_new(lpt_class); 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")) { if(s==gensym("lp")) {
error("lpt: the use of 'lp' has been deprecated; use 'lpt' instead"); 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) ...@@ -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); t_mline *x = (t_mline *)pd_new(mline_class);
int i; int i;
t_atom sane_default[1];
if (!argc) { if (!argc) {
argc = 1; argc = 1;
SETFLOAT(sane_default, 0.);
argv = sane_default;
x->time = 0; x->time = 0;
} else { } else {
x->time = atom_getfloat(argv+argc-1); x->time = atom_getfloat(argv+argc-1);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment