Permit Z_NULL arguments to deflatePending.

This avoids having to create useless variables for return values
that aren't needed.
This commit is contained in:
Mark Adler
2011-12-29 00:15:44 -08:00
parent 9d55abc969
commit 19761b8506
2 changed files with 6 additions and 3 deletions

View File

@@ -451,8 +451,10 @@ int ZEXPORT deflatePending (strm, pending, bits)
z_streamp strm;
{
if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
*pending = strm->state->pending;
*bits = strm->state->bi_valid;
if (pending != Z_NULL)
*pending = strm->state->pending;
if (bits != Z_NULL)
*bits = strm->state->bi_valid;
return Z_OK;
}