summaryrefslogtreecommitdiff
path: root/ext/standard/streamsfuncs.c
diff options
context:
space:
mode:
authorFelipe Pena <felipe@php.net>2008-10-30 14:34:25 +0000
committerFelipe Pena <felipe@php.net>2008-10-30 14:34:25 +0000
commit1eb552a7128a85cbed43f72b61ea74d021fece68 (patch)
tree03211706c76f95d6aa07c40f4dcb87fd3bcef898 /ext/standard/streamsfuncs.c
parentb51214fce724ee62436311e4343e04ed4f3202b6 (diff)
downloadphp-git-1eb552a7128a85cbed43f72b61ea74d021fece68.tar.gz
- Fix the fix
- Improved test
Diffstat (limited to 'ext/standard/streamsfuncs.c')
-rw-r--r--ext/standard/streamsfuncs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c
index 505469c7dd..92e4f2d40c 100644
--- a/ext/standard/streamsfuncs.c
+++ b/ext/standard/streamsfuncs.c
@@ -411,7 +411,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;
}