summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2020-12-27 19:25:23 +0100
committerChristoph M. Becker <cmbecker69@gmx.de>2020-12-27 22:40:25 +0100
commit45b638afe031f73135b7063ee35ff24923c86467 (patch)
treec13cd17913b13d6ac9e93e45b7b6b02a048f3478
parent57430e6f1eb58e71c64fd9f66bd13a916bdb8b23 (diff)
downloadphp-git-45b638afe031f73135b7063ee35ff24923c86467.tar.gz
php_formatted_print() throws on failure
Closes GH-6542.
-rw-r--r--ext/standard/formatted_print.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/ext/standard/formatted_print.c b/ext/standard/formatted_print.c
index 9bb4a5cb06..ab205feb6f 100644
--- a/ext/standard/formatted_print.c
+++ b/ext/standard/formatted_print.c
@@ -770,7 +770,7 @@ PHP_FUNCTION(sprintf)
result = php_formatted_print(format, format_len, args, argc, 1);
if (result == NULL) {
- return;
+ RETURN_THROWS();
}
RETVAL_STR(result);
}
@@ -796,7 +796,7 @@ PHP_FUNCTION(vsprintf)
result = php_formatted_print(format, format_len, args, argc, -1);
efree(args);
if (result == NULL) {
- return;
+ RETURN_THROWS();
}
RETVAL_STR(result);
}
@@ -819,7 +819,7 @@ PHP_FUNCTION(printf)
result = php_formatted_print(format, format_len, args, argc, 1);
if (result == NULL) {
- return;
+ RETURN_THROWS();
}
rlen = PHPWRITE(ZSTR_VAL(result), ZSTR_LEN(result));
zend_string_efree(result);
@@ -848,7 +848,7 @@ PHP_FUNCTION(vprintf)
result = php_formatted_print(format, format_len, args, argc, -1);
efree(args);
if (result == NULL) {
- return;
+ RETURN_THROWS();
}
rlen = PHPWRITE(ZSTR_VAL(result), ZSTR_LEN(result));
zend_string_efree(result);
@@ -876,7 +876,7 @@ PHP_FUNCTION(fprintf)
result = php_formatted_print(format, format_len, args, argc, 2);
if (result == NULL) {
- return;
+ RETURN_THROWS();
}
php_stream_write(stream, ZSTR_VAL(result), ZSTR_LEN(result));
@@ -910,7 +910,7 @@ PHP_FUNCTION(vfprintf)
result = php_formatted_print(format, format_len, args, argc, -1);
efree(args);
if (result == NULL) {
- return;
+ RETURN_THROWS();
}
php_stream_write(stream, ZSTR_VAL(result), ZSTR_LEN(result));