Index: ext/standard/formatted_print.c =================================================================== RCS file: /repository/php-src/ext/standard/formatted_print.c,v retrieving revision 1.82.2.1.2.21 diff -u -r1.82.2.1.2.21 formatted_print.c --- ext/standard/formatted_print.c 20 Jan 2009 18:03:19 -0000 1.82.2.1.2.21 +++ ext/standard/formatted_print.c 7 Jul 2009 12:56:30 -0000 @@ -700,14 +700,14 @@ 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); } /* }}} */ @@ -716,14 +716,14 @@ 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); } /* }}} */ Index: sapi/cli/php_cli.c =================================================================== RCS file: /repository/php-src/sapi/cli/php_cli.c,v retrieving revision 1.129.2.13.2.34 diff -u -r1.129.2.13.2.34 php_cli.c --- sapi/cli/php_cli.c 9 Apr 2009 10:20:39 -0000 1.129.2.13.2.34 +++ sapi/cli/php_cli.c 7 Jul 2009 12:56:31 -0000 @@ -298,7 +298,7 @@ remaining -= ret; } - return str_length; + return (ptr - str); } /* }}} */