diff options
author | Gustavo André dos Santos Lopes <cataphract@php.net> | 2011-02-01 18:10:35 +0000 |
---|---|---|
committer | Gustavo André dos Santos Lopes <cataphract@php.net> | 2011-02-01 18:10:35 +0000 |
commit | da0e2a416f63315474af4bca95932dec3f08607b (patch) | |
tree | a729382dd74c5d68cd545257556b443b9edc6470 /ext/standard/streamsfuncs.c | |
parent | 6157793026660e3d721a0ea6e4003e29d102f876 (diff) | |
download | php-git-da0e2a416f63315474af4bca95932dec3f08607b.tar.gz |
- Fixed several comparisons that always result in true of false
due to signedness of one of the operands, either by removing
dead code or fixing it.
- Thrown some comments around in php_stream_get_record.
- See http://www.mail-archive.com/internals@lists.php.net/msg49525.html
Diffstat (limited to 'ext/standard/streamsfuncs.c')
-rw-r--r-- | ext/standard/streamsfuncs.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c index 0b96a500b8..99b7e44e05 100644 --- a/ext/standard/streamsfuncs.c +++ b/ext/standard/streamsfuncs.c @@ -634,7 +634,7 @@ static int stream_array_to_fd_set(zval *stream_array, fd_set *fds, php_socket_t * when casting. It is only used here so that the buffered data warning * is not displayed. * */ - if (SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL, (void*)&this_fd, 1) && this_fd >= 0) { + if (SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL, (void*)&this_fd, 1) && this_fd != -1) { PHP_SAFE_FD_SET(this_fd, fds); @@ -674,7 +674,7 @@ static int stream_array_from_fd_set(zval *stream_array, fd_set *fds TSRMLS_DC) * when casting. It is only used here so that the buffered data warning * is not displayed. */ - if (SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL, (void*)&this_fd, 1) && this_fd >= 0) { + if (SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL, (void*)&this_fd, 1) && this_fd != -1) { if (PHP_SAFE_FD_ISSET(this_fd, fds)) { zend_hash_next_index_insert(new_hash, (void *)elem, sizeof(zval *), (void **)&dest_elem); if (dest_elem) { |