From bd92164effef94464ced384d3f93f027adf2330d Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Tue, 11 May 2004 19:51:46 +0000 Subject: [PATCH] Make vprintf() and printf() return the length of the string printed. Make fprintf() and vfprints() return the correct length of the string printed. --- ext/standard/formatted_print.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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); } -- 2.50.1