- MFH: New parameter parsing API (for *printf())

This commit is contained in:
Felipe Pena 2008-08-10 21:49:01 +00:00
parent 1804a397e6
commit ef2489f6e7
2 changed files with 7 additions and 7 deletions

View File

@ -728,7 +728,7 @@ PHP_FUNCTION(vprintf)
PHP_FUNCTION(fprintf)
{
php_stream *stream;
zval **arg1;
zval *arg1;
char *result;
int len;
@ -736,11 +736,11 @@ PHP_FUNCTION(fprintf)
WRONG_PARAM_COUNT;
}
if (zend_get_parameters_ex(1, &arg1)==FAILURE) {
if (zend_parse_parameters(1 TSRMLS_CC, "r", &arg1) == FAILURE) {
RETURN_FALSE;
}
php_stream_from_zval(stream, arg1);
php_stream_from_zval(stream, &arg1);
if ((result=php_formatted_print(ht, &len, 0, 1 TSRMLS_CC))==NULL) {
RETURN_FALSE;
@ -759,7 +759,7 @@ PHP_FUNCTION(fprintf)
PHP_FUNCTION(vfprintf)
{
php_stream *stream;
zval **arg1;
zval *arg1;
char *result;
int len;
@ -767,11 +767,11 @@ PHP_FUNCTION(vfprintf)
WRONG_PARAM_COUNT;
}
if (zend_get_parameters_ex(1, &arg1)==FAILURE) {
if (zend_parse_parameters(1 TSRMLS_CC, "r", &arg1) == FAILURE) {
RETURN_FALSE;
}
php_stream_from_zval(stream, arg1);
php_stream_from_zval(stream, &arg1);
if ((result=php_formatted_print(ht, &len, 1, 1 TSRMLS_CC))==NULL) {
RETURN_FALSE;

View File

@ -35,7 +35,7 @@ unlink( $file );
--EXPECTF--
-- Testing vfprintf() function with other strangeties --
Warning: vfprintf(): supplied argument is not a valid stream resource in %s on line %d
Warning: vfprintf() expects parameter 1 to be resource, string given in %s on line %d
bool(false)
Warning: vfprintf(): Argument number must be greater than zero in %s on line %d