This is the mail archive of the
gsl-discuss@sources.redhat.com
mailing list for the GSL project.
segfault in mt_get
- From: tlb at trevorblackwell dot com
- To: gsl-discuss at sources dot redhat dot com
- Date: Mon, 17 Jun 2002 10:47:45 -0700
- Subject: segfault in mt_get
Sometimes mt_get (gsl/rng/mt.c) segfaults; the problem is that the
default mt_set fails to initialize state->mti. Below is a patch.
Index: mt.c
===================================================================
RCS file: /cvs/gsl/gsl/rng/mt.c,v
retrieving revision 1.16
diff -u -u -r1.16 mt.c
--- mt.c 13 May 2002 20:35:18 -0000 1.16
+++ mt.c 17 Jun 2002 17:44:21 -0000
@@ -148,6 +148,8 @@
state->mt[i] &= 0xffffffffUL;
}
+
+ state->mti = i;
}
static void
--
Trevor Blackwell tlb@trevorblackwell.com (650) 776-7870