| * zlib wrappers to make sure we don't silently miss errors |
| void git_inflate_init(z_streamp strm) |
| switch (inflateInit(strm)) { |
| die("inflateInit: %s (%s)", err, strm->msg ? strm->msg : "no message"); |
| void git_inflate_end(z_streamp strm) |
| if (inflateEnd(strm) != Z_OK) |
| error("inflateEnd: %s", strm->msg ? strm->msg : "failed"); |
| int git_inflate(z_streamp strm, int flush) |
| int ret = inflate(strm, flush); |
| /* Out of memory is fatal. */ |
| die("inflate: out of memory"); |
| /* Data corruption errors: we may want to recover from them (fsck) */ |
| err = "needs dictionary"; break; |
| err = "data stream error"; break; |
| err = "stream consistency error"; break; |
| err = "unknown error"; break; |
| /* Z_BUF_ERROR: normal, needs more space in the output buffer */ |
| error("inflate: %s (%s)", err, strm->msg ? strm->msg : "no message"); |