While I am there: - factor out the binary test to an inline function. - use size_t where appropriate. - check for <= 0 in gzread; it returns -1 on error.