Skip to content

Commit ede6eca

Browse files
committed
fix signed/unsigned warning and add a note
1 parent 9b7d255 commit ede6eca

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ext/zlib/zlib_fopen_wrapper.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,23 +37,25 @@ static size_t php_gziop_read(php_stream *stream, char *buf, size_t count TSRMLS_
3737
struct php_gz_stream_data_t *self = (struct php_gz_stream_data_t *) stream->abstract;
3838
int read;
3939

40+
/* XXX this needs to be looped for the case count > UINT_MAX */
4041
read = gzread(self->gz_file, buf, count);
4142

4243
if (gzeof(self->gz_file)) {
4344
stream->eof = 1;
4445
}
4546

46-
return (read < 0) ? 0 : read;
47+
return (size_t)((read < 0) ? 0 : read);
4748
}
4849

4950
static size_t php_gziop_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC)
5051
{
5152
struct php_gz_stream_data_t *self = (struct php_gz_stream_data_t *) stream->abstract;
5253
int wrote;
5354

55+
/* XXX this needs to be looped for the case count > UINT_MAX */
5456
wrote = gzwrite(self->gz_file, (char *) buf, count);
5557

56-
return (wrote < 0) ? 0 : wrote;
58+
return (size_t)((wrote < 0) ? 0 : wrote);
5759
}
5860

5961
static int php_gziop_seek(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffs TSRMLS_DC)

0 commit comments

Comments
 (0)