This is the mail archive of the gsl-discuss@sources.redhat.com mailing list for the GSL project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]