summaryrefslogtreecommitdiff
path: root/gzread.c
diff options
context:
space:
mode:
authorMark Adler <madler@alumni.caltech.edu>2016-10-11 22:15:50 -0700
committerHans Kristian Rosbach <hk-git@circlestorm.org>2017-01-31 12:24:20 +0100
commitf9bb580bcba2e94eb1c931d0d8d9146d86704557 (patch)
tree5b304d549df2af887cd3f8c006911953f1bd1eec /gzread.c
parent52380f5b4475ad92c4aa5f033fa119fcb914e633 (diff)
Clean up type conversions.
Based on upstream 7096424f23df1b1813237fb5f8bc8f34cfcedd0c, but modified heavily to match zlib-ng.
Diffstat (limited to 'gzread.c')
-rw-r--r--gzread.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gzread.c b/gzread.c
index 970b649..1b1417c 100644
--- a/gzread.c
+++ b/gzread.c
@@ -18,14 +18,14 @@ static int gz_skip(gz_statep, z_off64_t);
This function needs to loop on read(), since read() is not guaranteed to
read the number of bytes requested, depending on the type of descriptor. */
static int gz_load(gz_statep state, unsigned char *buf, unsigned len, unsigned *have) {
- int ret;
+ ssize_t ret;
*have = 0;
do {
ret = read(state->fd, buf + *have, len - *have);
if (ret <= 0)
break;
- *have += ret;
+ *have += (unsigned)ret;
} while (*have < len);
if (ret < 0) {
gz_error(state, Z_ERRNO, zstrerror());
@@ -402,7 +402,7 @@ int ZEXPORT gzungetc(int c, gzFile file) {
if (state->x.have == 0) {
state->x.have = 1;
state->x.next = state->out + (state->size << 1) - 1;
- state->x.next[0] = c;
+ state->x.next[0] = (unsigned char)c;
state->x.pos--;
state->past = 0;
return c;
@@ -424,7 +424,7 @@ int ZEXPORT gzungetc(int c, gzFile file) {
}
state->x.have++;
state->x.next--;
- state->x.next[0] = c;
+ state->x.next[0] = (unsigned char)c;
state->x.pos--;
state->past = 0;
return c;