summaryrefslogtreecommitdiff
path: root/deflate.c
diff options
context:
space:
mode:
authorMark Adler <madler@alumni.caltech.edu>2011-12-29 00:15:44 -0800
committerMark Adler <madler@alumni.caltech.edu>2011-12-29 00:15:44 -0800
commit19761b8506f15d6eeeb6ccfab33a11abce0f40e7 (patch)
treecdc30a695e75ce713f6688b0c95c1cb411e2e55c /deflate.c
parent9d55abc96968db80749df5ebf412d36e2d66de26 (diff)
downloadzlib-19761b8506f15d6eeeb6ccfab33a11abce0f40e7.tar.gz
Permit Z_NULL arguments to deflatePending.
This avoids having to create useless variables for return values that aren't needed.
Diffstat (limited to 'deflate.c')
-rw-r--r--deflate.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/deflate.c b/deflate.c
index 159e665..eed6ed8 100644
--- a/deflate.c
+++ b/deflate.c
@@ -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;
}