moved call to subcommand_save outside multipass_procedure_with_splits
[pspp] / src / math / linreg / coefficient.c
index 5efde99e73fd22a7bd94d25281255fc1c224b100..d1fcbfa2e4bb6a145d0404c9d5493c7c397a62a8 100644 (file)
@@ -164,7 +164,7 @@ pspp_linreg_coeff_get_value (struct pspp_linreg_coeff *c,
     {
       return NULL;
     }
-  if (v->type == NULL)
+  if (v->type == NUMERIC)
     {
       return NULL;
     }
@@ -196,7 +196,7 @@ pspp_linreg_get_coeff (const pspp_linreg_cache * c,
     {
       return NULL;
     }
-  if (c->coeff == NULL || c->n_indeps == NULL || v == NULL)
+  if (c->coeff == NULL || c->n_indeps == 0 || v == NULL)
     {
       return NULL;
     }
@@ -209,7 +209,7 @@ pspp_linreg_get_coeff (const pspp_linreg_cache * c,
       tmp = pspp_linreg_coeff_get_var (result, 0);
       i++;
     }
-  if (i == c->n_coeffs)
+  if (i > c->n_coeffs)
     {
       return NULL;
     }