summaryrefslogtreecommitdiff
path: root/ext/standard/lcg.c
diff options
context:
space:
mode:
authorSascha Schumann <sas@php.net>2003-03-31 03:24:18 +0000
committerSascha Schumann <sas@php.net>2003-03-31 03:24:18 +0000
commitcb3c506639cdbf5a278def55242f85c075175ed3 (patch)
treeee0aea6a338fe47776546006dda0c5eca7879980 /ext/standard/lcg.c
parent2dc5d2b71338f390370abb8efe043cb1fb2d2d55 (diff)
downloadphp-git-cb3c506639cdbf5a278def55242f85c075175ed3.tar.gz
Ensure that the seed function has been called, even if we are used by
another module's request init function. Noticed by: marcus.boerger@t-online.de
Diffstat (limited to 'ext/standard/lcg.c')
-rw-r--r--ext/standard/lcg.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/standard/lcg.c b/ext/standard/lcg.c
index 13b74816bb..1c406fd5e3 100644
--- a/ext/standard/lcg.c
+++ b/ext/standard/lcg.c
@@ -61,6 +61,10 @@ PHPAPI double php_combined_lcg(TSRMLS_D)
{
php_int32 q;
php_int32 z;
+
+ if (!LCG(seeded)) {
+ lcg_seed(TSRMLS_C);
+ }
MODMULT(53668, 40014, 12211, 2147483563L, LCG(s1));
MODMULT(52774, 40692, 3791, 2147483399L, LCG(s2));