cvs: /php3/functions rand.c
| From: | Brian Havard | Date: | Thu, 02 Mar 2000 16:00:33 +0000 |
| Subject: | cvs: /php3/functions rand.c | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-16281@lists.php.net to get a copy of this message | ||
bjh Thu Mar 2 08:00:33 2000 EDT
Modified files:
/php3/functions rand.c
Log:
Fix random number ranges on OS/2. This is necessary because the C library
used in EMX GCC provides both rand() and random() but RAND_MAX (32767) is
only correct for rand(). random() goes up to 2^31-1.
Fixes Bug id #3085
Index: php3/functions/rand.c
diff -u php3/functions/rand.c:1.36 php3/functions/rand.c:1.37
--- php3/functions/rand.c:1.36 Fri Dec 31 20:31:16 1999
+++ php3/functions/rand.c Thu Mar 2 08:00:32 2000
@@ -30,7 +30,7 @@
| Based on code from: Shawn Cokus <Cokus@math.washington.edu> |
+----------------------------------------------------------------------+
*/
-/* $Id: rand.c,v 1.36 2000/01/01 04:31:16 sas Exp $ */
+/* $Id: rand.c,v 1.37 2000/03/02 16:00:32 bjh Exp $ */
#include <stdlib.h>
@@ -207,7 +207,7 @@
}
-#if HAVE_LRAND48
+#if HAVE_LRAND48 || (OS2 && HAVE_RANDOM)
#define PHP_RAND_MAX 2147483647
#else
#define PHP_RAND_MAX RAND_MAX