projects
/
pspp
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c4cc86c
)
interaction.c: interaction_dump: don't crash on empty interactions (ie those with...
20120304030503/pspp
20120305030502/pspp
20120306030503/pspp
20120307030505/pspp
20120308030501/pspp
20120309030503/pspp
20120310030505/pspp
author
John Darrington
<john@darrington.wattle.id.au>
Sat, 3 Mar 2012 11:20:45 +0000
(12:20 +0100)
committer
John Darrington
<john@darrington.wattle.id.au>
Sat, 3 Mar 2012 11:20:45 +0000
(12:20 +0100)
src/math/interaction.c
patch
|
blob
|
history
diff --git
a/src/math/interaction.c
b/src/math/interaction.c
index 706092476ec2b3bb8f3f391de37338ffe2ccdbed..a36755b541265fbc3da3e1ca8fcc465ec0ea120e 100644
(file)
--- a/
src/math/interaction.c
+++ b/
src/math/interaction.c
@@
-146,11
+146,14
@@
void
interaction_dump (const struct interaction *i)
{
int v = 0;
- printf ("%s", var_get_name (i->vars[v]));
- for (v = 1; v < i->n_vars; ++v)
+ if ( i->n_vars == 0)
{
- printf (" * %s", var_get_name (i->vars[v]));
+ printf ("(empty)\n");
+ return;
}
+ printf ("%s", var_get_name (i->vars[v]));
+ for (v = 1; v < i->n_vars; ++v)
+ printf (" * %s", var_get_name (i->vars[v]));
printf ("\n");
}