]> granicus.if.org Git - zziplib/commit
zzip: fseeko: fix comparison between incompatible pointer types
authorPatrick Steinhardt <ps@pks.im>
Tue, 21 May 2019 11:24:29 +0000 (13:24 +0200)
committerPatrick Steinhardt <ps@pks.im>
Thu, 1 Aug 2019 06:33:34 +0000 (08:33 +0200)
commitfca2d6ac8d62a5edfc6932169164a327899ab3d0
tree1e5ed28ba362e403f53671d1ba4c45d7db3441b1
parent7ee11c737fc470b22d156229cbd5795e2acb5f4c
zzip: fseeko: fix comparison between incompatible pointer types

The C standard does not allow for comparing incompatible pointer types
with each other. This causes the C compiler to emit a warning when we
try to compare a pointer of type `struct zzip_disk64_trailer` (cast to
`void *`) with a pointer of type `unsigned char`.

Fix this by comparing `p + sizeof(trailer)` with `buffer + mapsize`
instead of using the cast struct.
zzip/fseeko.c