cvs: php4 /ext/standard rand.c
| From: | Fredrik �hrn | Date: | Tue, 20 Mar 2001 20:48:43 +0000 |
| Subject: | cvs: php4 /ext/standard rand.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-4724@lists.php.net to get a copy of this message | ||
ohrn Tue Mar 20 12:48:43 2001 EDT
Modified files:
/php4/ext/standard rand.c
Log:
Fix erronous out of bounds error message in rand(min,max)
Index: php4/ext/standard/rand.c
diff -u php4/ext/standard/rand.c:1.25 php4/ext/standard/rand.c:1.26
--- php4/ext/standard/rand.c:1.25 Sun Feb 25 22:07:23 2001
+++ php4/ext/standard/rand.c Tue Mar 20 12:48:42 2001
@@ -19,7 +19,7 @@
| Based on code from: Shawn Cokus <Cokus@math.washington.edu> |
+----------------------------------------------------------------------+
*/
-/* $Id: rand.c,v 1.25 2001/02/26 06:07:23 andi Exp $ */
+/* $Id: rand.c,v 1.26 2001/03/20 20:48:42 ohrn Exp $ */
#include <stdlib.h>
@@ -235,7 +235,7 @@
convert_to_long_ex(p_max);
if ((*p_max)->value.lval-(*p_min)->value.lval < 0) {
php_error(E_WARNING,"rand(): Invalid range: %ld..%ld", (*p_min)->value.lval,
(*p_max)->value.lval);
- }else if ((*p_max)->value.lval-(*p_min)->value.lval > RAND_MAX){
+ }else if ((*p_max)->value.lval-(*p_min)->value.lval > PHP_RAND_MAX){
php3_error(E_WARNING,"rand(): Invalid range: %ld..%ld", (*p_min)->value.lval,
(*p_max)->value.lval);
}
break;