From 3cdb27c57bc9abc79066ae10de2eb53bcfe418e9 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Mon, 19 Jan 2009 16:50:54 +0900 Subject: [PATCH] Fixed bug allocating the memory in NPAR BINOMIAL Thanks to Ben Pfaff for reporting this problem. --- src/language/stats/binomial.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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)) -- 2.30.2