summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2004-05-11 19:51:46 +0000
committerIlia Alshanetsky <iliaa@php.net>2004-05-11 19:51:46 +0000
commitbd92164effef94464ced384d3f93f027adf2330d (patch)
treed1d662cadd2c5f2caea728d81e3f14b8c874cac1
parent69b712410b663ebc1c14fd387a36443fba152178 (diff)
downloadphp-git-bd92164effef94464ced384d3f93f027adf2330d.tar.gz
Make vprintf() and printf() return the length of the string printed.
Make fprintf() and vfprints() return the correct length of the string printed.
-rw-r--r--ext/standard/formatted_print.c6
1 files 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);
}