readChunks returns an int, use const auto instead of size_t to be able to compare against -1.
mentioned in commit 1b3ef4a6