cvs: php4 /ext/standard lcg.c
| From: | Sascha Schumann | Date: | Mon, 31 Mar 2003 03:24:18 +0000 |
| Subject: | cvs: php4 /ext/standard lcg.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-19866@lists.php.net to get a copy of this message | ||
sas Sun Mar 30 22:24:18 2003 EDT
Modified files:
/php4/ext/standard lcg.c
Log:
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
Index: php4/ext/standard/lcg.c
diff -u php4/ext/standard/lcg.c:1.34 php4/ext/standard/lcg.c:1.35
--- php4/ext/standard/lcg.c:1.34 Tue Dec 31 11:07:45 2002
+++ php4/ext/standard/lcg.c Sun Mar 30 22:24:18 2003
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: lcg.c,v 1.34 2002/12/31 16:07:45 sebastian Exp $ */
+/* $Id: lcg.c,v 1.35 2003/03/31 03:24:18 sas Exp $ */
#include "php.h"
#include "php_lcg.h"
@@ -61,6 +61,10 @@
{
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));