diff options
author | corvid <corvid@lavabit.com> | 2009-02-23 19:09:20 +0000 |
---|---|---|
committer | corvid <corvid@lavabit.com> | 2009-02-23 19:09:20 +0000 |
commit | 97d8649b4c653ac4070ad54b7365fd0a083d47f3 (patch) | |
tree | 7b217300b5df6dfd54766ee5ee2bc9ca5949a074 /src/decode.c | |
parent | 0f36a7204db62f760c71c783148eb1fb97eb7206 (diff) |
let's keep what was successfully uncompressed before encountering error
Diffstat (limited to 'src/decode.c')
-rw-r--r-- | src/decode.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/decode.c b/src/decode.c index 1207d68d..b4dd5214 100644 --- a/src/decode.c +++ b/src/decode.c @@ -106,13 +106,12 @@ static Dstr *Decode_gzip(Decode *dc, const char *instr, int inlen) rc = inflate(zs, Z_SYNC_FLUSH); + dStr_append_l(output, dc->buffer, zs->total_out); + if ((rc == Z_OK) || (rc == Z_STREAM_END)) { // Z_STREAM_END at end of file inputConsumed += zs->total_in; - - dStr_append_l(output, dc->buffer, zs->total_out); - zs->total_out = 0; zs->total_in = 0; } else if (rc == Z_DATA_ERROR) { |