Wow, this is a blast from the past. When I wrote the pngchunks command in 2003, I had never seen a 64 bit machine, and knew enough to check that an int was the right size, but not enough to just use the guaranteed-to-be-32-bit version from day 1. I’d pretty much forgotten about this code until I got pinged about this Debian bug. The bug reporter is entirely right, this was lame.
PNGtools 0.4 should be 64 bit safe. The pngchunks command works on my 64 bit machines at least.
A historical note from November 2020: this code is quite old, but still actively used. I have therefore converted the old subversion repository to git and it is hosted at https://github.com/mikalstill/pngtools. I will monitor there for issues and patches and try my best to remember what I was thinking 20 years ago…