From: John Darrington Date: Mon, 19 Jan 2009 07:50:54 +0000 (+0900) Subject: Fixed bug allocating the memory in NPAR BINOMIAL X-Git-Tag: v0.7.1~5 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3cdb27c57bc9abc79066ae10de2eb53bcfe418e9;p=pspp-builds.git Fixed bug allocating the memory in NPAR BINOMIAL Thanks to Ben Pfaff for reporting this problem. --- diff --git a/src/language/stats/binomial.c b/src/language/stats/binomial.c index 15d0e403..65fb22e6 100644 --- a/src/language/stats/binomial.c +++ b/src/language/stats/binomial.c @@ -158,16 +158,20 @@ binomial_execute (const struct dataset *ds, if ( bst->category1 != SYSMIS ) { + int i; union value v; v.f = bst->category1; - cat1->value = value_dup (&v, 0); + for (i = 0; i < ost->n_vars; i++) + cat1[i].value = value_dup (&v, 0); } if ( bst->category2 != SYSMIS ) { + int i; union value v; v.f = bst->category2; - cat2->value = value_dup (&v, 0); + for (i = 0; i < ost->n_vars; i++) + cat2[i].value = value_dup (&v, 0); } if (do_binomial (dataset_dict(ds), input, bst, cat1, cat2, exclude))