From 53b64418c20b6288e0e3a589b61db47861a575b6 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 13 Aug 2013 08:00:58 -0700 Subject: [PATCH] * decompress.c (Fzlib_decompress_region): Try to clarify 'avail_out'. --- src/ChangeLog | 4 ++++ src/decompress.c | 9 ++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index dabc6241967..0c8de046034 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2013-08-13 Paul Eggert + + * decompress.c (Fzlib_decompress_region): Try to clarify 'avail_out'. + 2013-08-13 Dmitry Antipov * window.h (struct window): Convert left_margin_cols and diff --git a/src/decompress.c b/src/decompress.c index a09033ab8c3..b7cd8a6c404 100644 --- a/src/decompress.c +++ b/src/decompress.c @@ -26,6 +26,8 @@ along with GNU Emacs. If not, see . */ #include "character.h" #include "buffer.h" +#include + 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; -- 2.39.2