diff options
Diffstat (limited to 'lib/Handle.cc')
-rw-r--r-- | lib/Handle.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/Handle.cc b/lib/Handle.cc index 5c046d5..1701cd9 100644 --- a/lib/Handle.cc +++ b/lib/Handle.cc @@ -875,14 +875,14 @@ int Handle::zlib_deflate(Handle * in, Handle * out) throw (GeneralException) { } #ifdef HAVE_UCL -int Handle::ucl_compress(Handle * in, Handle * out) throw (GeneralException) { +int Handle::ucl_compress(Handle * in, Handle * out, int len_in) throw (GeneralException) { if (ucl_init() != UCL_E_OK) throw GeneralException("ucl_init failed"); unsigned char * b_in, * b_out; - unsigned int len_in, len_out; + unsigned int len_out; - len_in = in->GetSize(); + if (len_in < 0) len_in = in->GetSize() - in->tell(); len_out = len_in + len_in / 8 + 256; b_in = (unsigned char *) malloc(len_in); @@ -901,14 +901,14 @@ int Handle::ucl_compress(Handle * in, Handle * out) throw (GeneralException) { return len_out; } -int Handle::ucl_decompress(Handle * in, Handle * out) throw (GeneralException) { +int Handle::ucl_decompress(Handle * in, Handle * out, int len_in) throw (GeneralException) { if (ucl_init() != UCL_E_OK) throw GeneralException("ucl_init failed"); unsigned char * b_in, * b_out; - unsigned int len_in, len_out; + unsigned int len_out; - len_in = in->GetSize(); + if (len_in < 0) len_in = in->GetSize() - in->tell(); len_out = len_in + len_in / 8 + 256; b_in = (unsigned char *) malloc(len_in); |