diff options
-rw-r--r-- | deflate.c | 6 | ||||
-rw-r--r-- | zlib.h | 3 |
2 files changed, 6 insertions, 3 deletions
@@ -451,8 +451,10 @@ int ZEXPORT deflatePending (strm, pending, bits) | |||
451 | z_streamp strm; | 451 | z_streamp strm; |
452 | { | 452 | { |
453 | if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; | 453 | if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; |
454 | *pending = strm->state->pending; | 454 | if (pending != Z_NULL) |
455 | *bits = strm->state->bi_valid; | 455 | *pending = strm->state->pending; |
456 | if (bits != Z_NULL) | ||
457 | *bits = strm->state->bi_valid; | ||
456 | return Z_OK; | 458 | return Z_OK; |
457 | } | 459 | } |
458 | 460 | ||
@@ -715,7 +715,8 @@ ZEXTERN int ZEXPORT deflatePending OF((z_streamp strm, | |||
715 | been generated, but not yet provided in the available output. The bytes not | 715 | been generated, but not yet provided in the available output. The bytes not |
716 | provided would be due to the available output space having being consumed. | 716 | provided would be due to the available output space having being consumed. |
717 | The number of bits of output not provided are between 0 and 7, where they | 717 | The number of bits of output not provided are between 0 and 7, where they |
718 | await more bits to join them in order to fill out a full byte. | 718 | await more bits to join them in order to fill out a full byte. If pending |
719 | or bits are Z_NULL, then those values are not set. | ||
719 | 720 | ||
720 | deflatePending returns Z_OK if success, or Z_STREAM_ERROR if the source | 721 | deflatePending returns Z_OK if success, or Z_STREAM_ERROR if the source |
721 | stream state was inconsistent. | 722 | stream state was inconsistent. |