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 deflate/inflate failure #297

Open
wants to merge 1 commit into
base: master
Choose a base branch
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 signaling 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("")).

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