summaryrefslogtreecommitdiff
path: root/src/filebuf.c
diff options
context:
space:
mode:
authorschu <schu-github@schulog.org>2011-09-09 14:05:32 +0200
committerschu <schu-github@schulog.org>2011-09-09 16:59:28 +0200
commitc8f16bfef992452fb4ef7622a2ecd810c1937225 (patch)
tree00559c7e6fafbea16ebf61e9a3d5397af9770648 /src/filebuf.c
parent3f3f6225f8237e974b135de30eaac731c929936e (diff)
downloadlibgit2-c8f16bfef992452fb4ef7622a2ecd810c1937225.tar.gz
filebuf.c: fix unused-but-set warning
write_deflate() used to ignore errors by zlib's deflate function when not compiling in DEBUG mode. Always read $result and throw an error instead. Signed-off-by: schu <schu-github@schulog.org>
Diffstat (limited to 'src/filebuf.c')
-rw-r--r--src/filebuf.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/filebuf.c b/src/filebuf.c
index e8c5087b7..7ec914227 100644
--- a/src/filebuf.c
+++ b/src/filebuf.c
@@ -126,7 +126,8 @@ static int write_deflate(git_filebuf *file, void *source, size_t len)
zs->avail_out = (uInt)file->buf_size;
result = deflate(zs, file->flush_mode);
- assert(result != Z_STREAM_ERROR);
+ if (result == Z_STREAM_ERROR)
+ return git__throw(GIT_ERROR, "Failed to deflate input");
have = file->buf_size - (size_t)zs->avail_out;