From: Ilia Alshanetsky Date: Tue, 11 May 2004 19:51:46 +0000 (+0000) Subject: Make vprintf() and printf() return the length of the string printed. X-Git-Tag: RELEASE_0_1~228 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bd92164effef94464ced384d3f93f027adf2330d;p=php Make vprintf() and printf() return the length of the string printed. Make fprintf() and vfprints() return the correct length of the string printed. --- diff --git a/ext/standard/formatted_print.c b/ext/standard/formatted_print.c index e12d0eebc9..ee33b17f36 100644 --- a/ext/standard/formatted_print.c +++ b/ext/standard/formatted_print.c @@ -781,6 +781,7 @@ PHP_FUNCTION(user_printf) } PHPWRITE(result, len); efree(result); + RETURN_LONG(len); } /* }}} */ @@ -796,6 +797,7 @@ PHP_FUNCTION(vprintf) } PHPWRITE(result, len); efree(result); + RETURN_LONG(len); } /* }}} */ @@ -826,7 +828,7 @@ PHP_FUNCTION(fprintf) efree(result); - RETVAL_LONG(len - 1); + RETURN_LONG(len); } /* {{{ proto int vfprintf(resource stream, string format, array args) @@ -856,7 +858,7 @@ PHP_FUNCTION(vfprintf) efree(result); - RETVAL_LONG(len - 1); + RETURN_LONG(len); }