X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fmath%2Flinreg%2Fcoefficient.c;h=d1fcbfa2e4bb6a145d0404c9d5493c7c397a62a8;hb=7102dc8607b7e6e25bdb9806f508dce71fe76ce4;hp=5efde99e73fd22a7bd94d25281255fc1c224b100;hpb=fa9e38d0f6ee72724eeeb92526b23898bf582a89;p=pspp diff --git a/src/math/linreg/coefficient.c b/src/math/linreg/coefficient.c index 5efde99e73..d1fcbfa2e4 100644 --- a/src/math/linreg/coefficient.c +++ b/src/math/linreg/coefficient.c @@ -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; }