Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lminiz: return nil on inflate/deflate failure #296

Closed
wants to merge 2 commits into from

Conversation

Bilal2453
Copy link
Contributor

@Bilal2453 Bilal2453 commented Aug 31, 2024

When miniz returns null on tdefl_compress_mem_to_heap and tinfl_decompress_mem_to_heap singling an error, lminiz will still return a string to the end user, an empty string in this case. This pull changes this behavior to return back a nil value plus an error message to be consistent with the rest of the API.

This change may not be necessarily wanted, as an empty string should still be valid for an error indication, as it seems miniz refuse to inflate a ZLib-ed empty string (i.e. an empty string with zlib header only, e.g. miniz.deflate("")).

@Bilal2453 Bilal2453 closed this Aug 31, 2024
@Bilal2453 Bilal2453 deleted the lminiz-err-handle branch August 31, 2024 00:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant