diff options
| author | Ramsay Jones <ramsay@ramsay1.demon.co.uk> | 2009-02-03 18:25:13 +0000 |
|---|---|---|
| committer | Shawn O. Pearce <spearce@spearce.org> | 2009-02-11 10:47:03 -0800 |
| commit | e9f5e87781e88aa3afa7679783c204604479f9e9 (patch) | |
| tree | e667e1741dc49767b8563796879f344bc2b08197 /src/odb.c | |
| parent | 236e7579fed7763be77209efb8708960982f3cb3 (diff) | |
| download | libgit2-e9f5e87781e88aa3afa7679783c204604479f9e9.tar.gz | |
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>
Diffstat (limited to 'src/odb.c')
| -rw-r--r-- | src/odb.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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; |
