dmitry Tue Jul 1 10:01:09 2008 UTC
Modified files: (Branch: PHP_5_3)
/php-src/ext/standard formatted_print.c
/php-src/ext/standard/tests/strings fprintf_error.phpt
Log:
Use new parameter parsing API
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/formatted_print.c?r1=1.82.2.1.2.16.2.6&r2=1.82.2.1.2.16.2.7&diff_format=u
Index: php-src/ext/standard/formatted_print.c
diff -u php-src/ext/standard/formatted_print.c:1.82.2.1.2.16.2.6
php-src/ext/standard/formatted_print.c:1.82.2.1.2.16.2.7
--- php-src/ext/standard/formatted_print.c:1.82.2.1.2.16.2.6 Wed Jun 25
10:16:52 2008
+++ php-src/ext/standard/formatted_print.c Tue Jul 1 10:01:08 2008
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: formatted_print.c,v 1.82.2.1.2.16.2.6 2008/06/25 10:16:52 davidc Exp $
*/
+/* $Id: formatted_print.c,v 1.82.2.1.2.16.2.7 2008/07/01 10:01:08 dmitry Exp $
*/
#include <math.h> /* modf() */
#include "php.h"
@@ -379,16 +379,13 @@
char *format, *result, padding;
int always_sign;
- argc = ZEND_NUM_ARGS();
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", &args, &argc)
== FAILURE) {
+ return NULL;
+ }
/* verify the number of args */
if ((use_array && argc != (2 + format_offset))
|| (!use_array && argc < (1 + format_offset))) {
- WRONG_PARAM_COUNT_WITH_RETVAL(NULL);
- }
- args = (zval ***)safe_emalloc(argc, sizeof(zval *), 0);
-
- if (zend_get_parameters_array_ex(argc, args) == FAILURE) {
efree(args);
WRONG_PARAM_COUNT_WITH_RETVAL(NULL);
}
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/fprintf_error.phpt?r1=1.1.2.2.2.1&r2=1.1.2.2.2.2&diff_format=u
Index: php-src/ext/standard/tests/strings/fprintf_error.phpt
diff -u php-src/ext/standard/tests/strings/fprintf_error.phpt:1.1.2.2.2.1
php-src/ext/standard/tests/strings/fprintf_error.phpt:1.1.2.2.2.2
--- php-src/ext/standard/tests/strings/fprintf_error.phpt:1.1.2.2.2.1 Tue Jun
24 22:51:57 2008
+++ php-src/ext/standard/tests/strings/fprintf_error.phpt Tue Jul 1
10:01:09 2008
@@ -20,12 +20,12 @@
--EXPECTF--
*** Testing Error Conditions ***
-Warning: fprintf() expects at least %d parameters, %d given in %s on line %d
+Warning: Wrong parameter count for fprintf() in %sfprintf_error.php on line %d
NULL
-Warning: fprintf() expects at least %d parameters, %d given in %s on line %d
+Warning: Wrong parameter count for fprintf() in %sfprintf_error.php on line %d
NULL
-Warning: fprintf() expects at least %d parameters, %d given in %s on line %d
+Warning: Wrong parameter count for fprintf() in %sfprintf_error.php on line %d
NULL
Done
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php