summary refs log tree commit diff
path: root/bin/pngo.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-06-07 15:04:16 -0400
committerJune McEnroe <june@causal.agency>2020-06-07 15:04:16 -0400
commit9141d8b9e5b737e68b4d754b2edfddbd6af5545f (patch)
tree037cbd224ec26603706717649409290090c9d44f /bin/pngo.c
parentCall static_assert by _Static_assert (diff)
downloadsrc-9141d8b9e5b737e68b4d754b2edfddbd6af5545f.tar.gz
src-9141d8b9e5b737e68b4d754b2edfddbd6af5545f.zip
Cast z_stream fields to size_t
In the version of zlib in OpenBSD, these fields are of type off_t, which
is signed (why?), rather than uLong.
Diffstat (limited to 'bin/pngo.c')
-rw-r--r--bin/pngo.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/bin/pngo.c b/bin/pngo.c
index 6c74297c..080e0b95 100644
--- a/bin/pngo.c
+++ b/bin/pngo.c
@@ -385,14 +385,18 @@ static void readData(struct Chunk chunk) {
 	}
 
 	inflateEnd(&stream);
-	if (stream.total_out != dataSize()) {
+	if ((size_t)stream.total_out != dataSize()) {
 		errx(
-			EX_DATAERR, "%s: expected data size %zu, found %lu",
-			path, dataSize(), stream.total_out
+			EX_DATAERR, "%s: expected data size %zu, found %zu",
+			path, dataSize(), (size_t)stream.total_out
 		);
 	}
 
-	if (verbose) fprintf(stderr, "%s: deflate size %lu\n", path, stream.total_in);
+	if (verbose) {
+		fprintf(
+			stderr, "%s: deflate size %zu\n", path, (size_t)stream.total_in
+		);
+	}
 }
 
 static void writeData(void) {