commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r1163673 - /commons/sandbox/runtime/trunk/src/main/native/shared/zlib.c
Date Wed, 31 Aug 2011 15:49:17 GMT
Author: mturk
Date: Wed Aug 31 15:49:16 2011
New Revision: 1163673

URL: http://svn.apache.org/viewvc?rev=1163673&view=rev
Log:
Fix few copy/paste errors

Modified:
    commons/sandbox/runtime/trunk/src/main/native/shared/zlib.c

Modified: commons/sandbox/runtime/trunk/src/main/native/shared/zlib.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/shared/zlib.c?rev=1163673&r1=1163672&r2=1163673&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/shared/zlib.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/shared/zlib.c Wed Aug 31 15:49:16 2011
@@ -440,8 +440,10 @@ ACR_ZLIB_EXPORT(jint, ZlibDeflater, defl
             s->flush = Z_NO_FLUSH;
         return s->blen - s->zs.avail_out;
     }
-    else if (rc == Z_STREAM_END)
+    else if (rc == Z_STREAM_END) {
         s->eos = JNI_TRUE;
+        return s->blen - s->zs.avail_out;
+    }
     else if (rc != Z_BUF_ERROR)
         ACR_THROW_MSG(ACR_EX_EILSEQ, s->zs.msg);
     return 0;
@@ -640,7 +642,7 @@ ACR_ZLIB_EXPORT(jint, ZlibInflater, infl
     s->zs.avail_out = len;
     rc = inflate((z_streamp)s, s->flush);
     if (rc == Z_OK || rc == Z_STREAM_END) {
-        uInt ilen = s->blen - s->zs.avail_out;
+        uInt ilen = len - s->zs.avail_out;
         if (s->flush != Z_FINISH)
             s->flush = Z_NO_FLUSH;
         if (s->ccrc)
@@ -671,7 +673,7 @@ ACR_ZLIB_EXPORT(jint, ZlibInflater, infl
     s->zs.avail_out = len;
     rc = inflate((z_streamp)s, s->flush);
     if (rc == Z_OK || rc == Z_STREAM_END) {
-        uInt ilen = s->blen - s->zs.avail_out;
+        uInt ilen = len - s->zs.avail_out;
         if (s->flush != Z_FINISH)
             s->flush = Z_NO_FLUSH;
         if (s->ccrc)



Mime
View raw message