sniper Tue Nov 18 05:28:35 2003 EDT
Modified files: (Branch: PHP_4_3)
/php-src/ext/gmp gmp.c
Log:
MFH: fixed parameters for gmp_random()
Index: php-src/ext/gmp/gmp.c
diff -u php-src/ext/gmp/gmp.c:1.29.4.3 php-src/ext/gmp/gmp.c:1.29.4.4
--- php-src/ext/gmp/gmp.c:1.29.4.3 Mon Oct 13 07:47:05 2003
+++ php-src/ext/gmp/gmp.c Tue Nov 18 05:28:34 2003
@@ -1031,15 +1031,13 @@
argc = ZEND_NUM_ARGS();
- if (argc < 0 || argc > 1 || zend_get_parameters_ex(1, &limiter_arg) ==
FAILURE){
- WRONG_PARAM_COUNT;
- }
-
- if(argc) {
+ if (argc == 0) {
+ limiter = 20;
+ } else if (argc == 1 && zend_get_parameters_ex(1, &limiter_arg) == SUCCESS) {
convert_to_long_ex(limiter_arg);
limiter = Z_LVAL_PP(limiter_arg);
} else {
- limiter = 20;
+ WRONG_PARAM_COUNT;
}
INIT_GMP_NUM(gmpnum_result);
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php