]> granicus.if.org Git - php/commitdiff
- Fix proto
authorMarcus Boerger <helly@php.net>
Mon, 7 Mar 2005 22:10:08 +0000 (22:10 +0000)
committerMarcus Boerger <helly@php.net>
Mon, 7 Mar 2005 22:10:08 +0000 (22:10 +0000)
- Do not try to write zero bytes

ext/standard/file.c

index 7d8fd5ceacd82632fd787bf42ee6d275e2f338ed..8634f88f60ebdb18a3e2c5f8d1a8d178499dbada 100644 (file)
@@ -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)
 {