/* If any errors occur, such as a corrupted compressed stream, an error is printed an the platform's exit() function is called.  */
int gunzip_finish(struct gunzip_state *state, void *dst, int dstlen)
/* If any errors occur, such as a corrupted compressed stream, an error is printed an the platform's exit() function is called.  */
int gunzip_finish(struct gunzip_state *state, void *dst, int dstlen)
{
	int len;
	len = gunzip_partial(state, dst, dstlen);
	if (state->s.workspace) {
		zlib_inflateEnd(&state->s);
	}
	return len;
}