From 6bd825760716ffbf592d658d90fe03cfc107cee9 Mon Sep 17 00:00:00 2001 From: Marcus Boerger Date: Mon, 7 Mar 2005 22:10:08 +0000 Subject: [PATCH] - Fix proto - Do not try to write zero bytes --- ext/standard/file.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ext/standard/file.c b/ext/standard/file.c index 7d8fd5ceacd..8634f88f60e 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -1238,6 +1238,10 @@ PHPAPI PHP_FUNCTION(fwrite) break; } + if (!num_bytes) { + RETURN_LONG(0); + } + PHP_STREAM_TO_ZVAL(stream, arg1); if (PG(magic_quotes_runtime)) { @@ -1572,7 +1576,7 @@ PHP_NAMED_FUNCTION(php_if_ftruncate) } /* }}} */ -/* {{{ proto int fstat(resource fp) +/* {{{ proto array fstat(resource fp) Stat() on a filehandle */ PHP_NAMED_FUNCTION(php_if_fstat) {