libnxz / power-gzip

POWER NX zlib compliant library
23 stars 18 forks source link

Return Z_BUF_ERROR when no progress is made #111

Closed lucmaga closed 2 years ago

lucmaga commented 3 years ago

According to zlib.h, Z_BUF_ERROR should be returned when no progress was made. The same should be returned if flush is Z_FINISH and the inflate could not be done at once.

This fixes issue #74.

Signed-off-by: Lucas A. M. Magalhaes lamm@linux.ibm.com

tuliom commented 3 years ago

@lucmaga I think this kind of patch deserves a new test that validates if the library returns Z_BUF_ERROR for expected inputs and fail if it doesn't.

lucmaga commented 3 years ago

Agreed @tuliom I will some add tests to this pr.