X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fmath%2Fcoefficient.c;h=2feeedbaa8f2aff28ace93a23cd0a72fd0d43436;hb=b4fdd51a0bf62800c53c8a805f31ea735d931029;hp=5872b576fabfc82227aac28dae759ec43ded96ac;hpb=5f8dc7ca9962b212d623566e287b0f1d365f6398;p=pspp-builds.git diff --git a/src/math/coefficient.c b/src/math/coefficient.c index 5872b576..2feeedba 100644 --- a/src/math/coefficient.c +++ b/src/math/coefficient.c @@ -160,13 +160,21 @@ pspp_coeff_var_to_coeff (const struct variable *v, struct pspp_coeff **coefs, size_t i = 0; size_t j = 0; size_t v_idx; + int found = 0; struct pspp_coeff *result = NULL; if (v != NULL) { v_idx = var_get_dict_index (v); - while (i < n_coef && var_get_dict_index (coefs[i]->v_info->v) != v_idx) + while (i < n_coef) { + if (coefs[i]->v_info != NULL) + { + if (var_get_dict_index (coefs[i]->v_info->v) == v_idx) + { + break; + } + } i++; } result = coefs[i];