summaryrefslogtreecommitdiff
path: root/source/fitz/unzip.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2016-06-14 17:06:50 +0100
committerRobin Watts <robin.watts@artifex.com>2016-06-17 13:24:47 +0100
commit4a4e6adae4c1a0e9ab3b6fad477edfe26c1a2aca (patch)
tree4ed45be7545229ce5d8bb124a8332b5444004b1b /source/fitz/unzip.c
parentc9bad4ef3e32bc799b134bc3b258f9392cf60e3e (diff)
downloadmupdf-4a4e6adae4c1a0e9ab3b6fad477edfe26c1a2aca.tar.xz
Use 'size_t' instead of int as appropriate.
This silences the many warnings we get when building for x64 in windows. This does not address any of the warnings we get in thirdparty libraries - in particular harfbuzz. These look (at a quick glance) harmless though.
Diffstat (limited to 'source/fitz/unzip.c')
-rw-r--r--source/fitz/unzip.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/source/fitz/unzip.c b/source/fitz/unzip.c
index 21cfa7a5..929c1d5a 100644
--- a/source/fitz/unzip.c
+++ b/source/fitz/unzip.c
@@ -214,24 +214,26 @@ static void read_zip_dir(fz_context *ctx, fz_archive *zip)
{
fz_stream *file = zip->file;
unsigned char buf[512];
- int size, back, maxback;
- int i, n;
+ size_t size, back, maxback;
+ size_t i, n;
fz_seek(ctx, file, 0, SEEK_END);
size = fz_tell(ctx, file);
- maxback = fz_mini(size, 0xFFFF + sizeof buf);
- back = fz_mini(maxback, sizeof buf);
+ maxback = fz_minz(size, 0xFFFF + sizeof buf);
+ back = fz_minz(maxback, sizeof buf);
while (back < maxback)
{
fz_seek(ctx, file, size - back, 0);
n = fz_read(ctx, file, buf, sizeof buf);
+ if (n < 4)
+ break;
for (i = n - 4; i > 0; i--)
{
if (!memcmp(buf + i, "PK\5\6", 4))
{
- read_zip_dir_imp(ctx, zip, size - back + i);
+ read_zip_dir_imp(ctx, zip, (int)(size - back + i));
return;
}
}