Fix size_t/off_t size warnings

This commit is contained in:
Jason Perkins 2015-12-28 12:05:21 -05:00
parent 7d8af16ca0
commit 8c7d97001f
3 changed files with 4 additions and 4 deletions

View File

@ -541,7 +541,7 @@ write_cdir(struct zip *za, const struct zip_filelist *filelist, zip_uint64_t sur
/* fix up torrentzip comment */
if (_zip_filerange_crc(out, cd_start, size, &crc, &za->error) < 0)
if (_zip_filerange_crc(out, cd_start, (off_t)size, &crc, &za->error) < 0)
return -1;
snprintf(buf, sizeof(buf), "%08lX", (long)crc);

View File

@ -48,7 +48,7 @@ zip_error_to_str(char *buf, zip_uint64_t len, int ze, int se)
const char *zs, *ss;
if (ze < 0 || ze >= _zip_nerr_str)
return snprintf(buf, len, "Unknown error %d", ze);
return snprintf(buf, (size_t)len, "Unknown error %d", ze);
zs = _zip_err_str[ze];
@ -65,6 +65,6 @@ zip_error_to_str(char *buf, zip_uint64_t len, int ze, int se)
ss = NULL;
}
return snprintf(buf, len, "%s%s%s",
return snprintf(buf, (size_t)len, "%s%s%s",
zs, (ss ? ": " : ""), (ss ? ss : ""));
}

View File

@ -103,7 +103,7 @@ read_data(void *state, void *data, zip_uint64_t len, enum zip_source_cmd cmd)
n = len;
if (n) {
memcpy(buf, z->buf, n);
memcpy(buf, z->buf, (size_t)n);
z->buf += n;
}