* decompress.c (Fzlib_decompress_region): Try to clarify 'avail_out'.
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 13 Aug 2013 15:00:58 +0000 (08:00 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 13 Aug 2013 15:00:58 +0000 (08:00 -0700)
src/ChangeLog
src/decompress.c

index dabc624..0c8de04 100644 (file)
@@ -1,3 +1,7 @@
+2013-08-13  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * decompress.c (Fzlib_decompress_region): Try to clarify 'avail_out'.
+
 2013-08-13  Dmitry Antipov  <dmantipov@yandex.ru>
 
        * window.h (struct window): Convert left_margin_cols and
index a09033a..b7cd8a6 100644 (file)
@@ -26,6 +26,8 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include "character.h"
 #include "buffer.h"
 
+#include <verify.h>
+
 static Lisp_Object Qzlib_dll;
 
 #ifdef WINDOWSNT
@@ -178,10 +180,11 @@ This function can be called only in unibyte buffers.  */)
   do
     {
       /* Maximum number of bytes that one 'inflate' call should read and write.
-        zlib requires that these values not exceed UINT_MAX.
-        Do not make avail_out too large, as that might unduly delay C-g.  */
+        Do not make avail_out too large, as that might unduly delay C-g.
+        In any case zlib requires that these values not exceed UINT_MAX.  */
       ptrdiff_t avail_in = min (iend - pos_byte, UINT_MAX);
-      ptrdiff_t avail_out = min (1 << 14, UINT_MAX);
+      enum { avail_out = 1 << 14 };
+      verify (avail_out <= UINT_MAX);
 
       ptrdiff_t decompressed;