diff --git a/Source/cbzip2.h b/Source/cbzip2.h index 5d5d6189..638b16c9 100644 --- a/Source/cbzip2.h +++ b/Source/cbzip2.h @@ -40,9 +40,13 @@ class CBzip2 : public ICompressor { int Compress(bool finish) { // act like zlib when it comes to stream ending if (last_ret == BZ_STREAM_END && finish) - return BZ_STREAM_END; + return C_FINISHED; last_ret = BZ2_bzCompress(stream, finish?BZ_FINISH:0); - return last_ret; + + if (last_ret < 0) + return last_ret; + + return C_OK; } void SetNextIn(char *in, unsigned int size) {