mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-29 05:50:21 +00:00
Rearrange some code to improve clarity
In particular, the test for z-stream input completion (zs.avail_in != 0) logically belongs with the test for the Z_STREAM_END stream status. This is also consistent with the identical check in finish_inflate(). Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
This commit is contained in:
parent
236e7579fe
commit
e9f5e87781
@ -390,10 +390,10 @@ static int inflate_buffer(void *in, size_t inlen, void *out, size_t outlen)
|
||||
|
||||
inflateEnd(&zs);
|
||||
|
||||
if ((status != Z_STREAM_END) || (zs.total_out != outlen))
|
||||
if ((status != Z_STREAM_END) || (zs.avail_in != 0))
|
||||
return GIT_ERROR;
|
||||
|
||||
if (zs.avail_in != 0)
|
||||
if (zs.total_out != outlen)
|
||||
return GIT_ERROR;
|
||||
|
||||
return GIT_SUCCESS;
|
||||
|
Loading…
Reference in New Issue
Block a user