diff options
author | Robin Watts <robin.watts@artifex.com> | 2015-12-14 16:13:03 +0000 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2015-12-14 16:22:33 +0000 |
commit | 4f425a3ac7bb9e810995dfba814c1d024c0ebf70 (patch) | |
tree | f2f5fd3c33ef9c961ff7dbf94a09d28ffed7fd0f /source/fitz | |
parent | 04108f759e1445c4b9158dc22aca27a79cbad238 (diff) | |
download | mupdf-4f425a3ac7bb9e810995dfba814c1d024c0ebf70.tar.xz |
Fix signed/unsigned warning.
Seen with MSVC.
Diffstat (limited to 'source/fitz')
-rw-r--r-- | source/fitz/output.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source/fitz/output.c b/source/fitz/output.c index e39dd352..1f713709 100644 --- a/source/fitz/output.c +++ b/source/fitz/output.c @@ -13,8 +13,12 @@ static int file_write(fz_context *ctx, void *opaque, const void *buffer, int count) { FILE *file = opaque; - size_t n = fwrite(buffer, 1, count, file); - if (n < count && ferror(file)) + size_t n; + + if (count < 0) + return 0; + n = fwrite(buffer, 1, count, file); + if (n < (size_t)count && ferror(file)) fz_throw(ctx, FZ_ERROR_GENERIC, "cannot fwrite: %s", strerror(errno)); return n; } |