Skip to content

Commit

Permalink
- Fixed bug #48802 (printf() returns incorrect outputted length)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jani Taskinen committed Jul 23, 2009
1 parent e02a2ac commit eddb79e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions NEWS
Expand Up @@ -13,6 +13,7 @@ PHP NEWS
option is an array). (David Zülke)
- Fixed bug #48913 (Too long error code strings in pdo_odbc driver).
(naf at altlinux dot ru, Felipe)
- Fixed bug #48802 (printf() returns incorrect outputted length). (Jani)
- Fixed bug #48788 (RecursiveDirectoryIterator doesn't descend into symlinked
directories). (Ilia)
- Fixed bug #48763 (ZipArchive produces corrupt archive). (dani dot church at
Expand Down
12 changes: 6 additions & 6 deletions ext/standard/formatted_print.c
Expand Up @@ -700,14 +700,14 @@ PHP_FUNCTION(vsprintf)
PHP_FUNCTION(user_printf)
{
char *result;
int len;
int len, rlen;

if ((result=php_formatted_print(ht, &len, 0, 0 TSRMLS_CC))==NULL) {
RETURN_FALSE;
}
PHPWRITE(result, len);
rlen = PHPWRITE(result, len);
efree(result);
RETURN_LONG(len);
RETURN_LONG(rlen);
}
/* }}} */

Expand All @@ -716,14 +716,14 @@ PHP_FUNCTION(user_printf)
PHP_FUNCTION(vprintf)
{
char *result;
int len;
int len, rlen;

if ((result=php_formatted_print(ht, &len, 1, 0 TSRMLS_CC))==NULL) {
RETURN_FALSE;
}
PHPWRITE(result, len);
rlen = PHPWRITE(result, len);
efree(result);
RETURN_LONG(len);
RETURN_LONG(rlen);
}
/* }}} */

Expand Down
2 changes: 1 addition & 1 deletion sapi/cli/php_cli.c
Expand Up @@ -298,7 +298,7 @@ static int sapi_cli_ub_write(const char *str, uint str_length TSRMLS_DC) /* {{{
remaining -= ret;
}

return str_length;
return (ptr - str);
}
/* }}} */

Expand Down

0 comments on commit eddb79e

Please sign in to comment.