From 19761b8506f15d6eeeb6ccfab33a11abce0f40e7 Mon Sep 17 00:00:00 2001 From: Mark Adler Date: Thu, 29 Dec 2011 00:15:44 -0800 Subject: Permit Z_NULL arguments to deflatePending. This avoids having to create useless variables for return values that aren't needed. --- deflate.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'deflate.c') 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; } -- cgit v1.2.1