]> granicus.if.org Git - php/commitdiff
- Fix the fix (thanks Hannes!)
authorFelipe Pena <felipe@php.net>
Thu, 30 Oct 2008 14:30:02 +0000 (14:30 +0000)
committerFelipe Pena <felipe@php.net>
Thu, 30 Oct 2008 14:30:02 +0000 (14:30 +0000)
ext/standard/streamsfuncs.c

index 043fe9dc549db815a22521b189d56361e88e7b7e..93ac9306dee1894ab033c25ff5bf0f1ca899c1ad 100644 (file)
@@ -408,7 +408,7 @@ PHP_FUNCTION(stream_get_contents)
 
        php_stream_from_zval(stream, &zsrc);
 
-       if (pos >= 0 && php_stream_seek(stream, pos, SEEK_SET) < 0) {
+       if ((pos > 0 || (pos == 0 && ZEND_NUM_ARGS() > 2)) && php_stream_seek(stream, pos, SEEK_SET) < 0) {
                php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to seek to position %ld in the stream", pos);
                RETURN_FALSE;
        }