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

CLI: Only compression level 0 supported, others give error "lz4: invalid compression level: 1" #214

Closed
corneliusroemer opened this issue Dec 25, 2023 · 3 comments

Comments

@corneliusroemer
Copy link
Contributor

I gave the CLI a spin as it has multithreading support in contrast to the official CLI.

I installed it via: go install github.com/wkhere/lz4/cmd/lz4c@latest, see #174

There seems to be a bug in how the compression level is used from the CLI. Only level 0 is accepted without error. Otherwise, I get errors:

❯ echo "Hello\nNice" | ~/go/bin/lz4c compress -l=-1
lz4: invalid compression level: 4294967295

❯ echo "Hello\nNice" | ~/go/bin/lz4c compress -l=1 
lz4: invalid compression level: 1

❯ echo "Hello\nNice" | ~/go/bin/lz4c compress -l=0
"M`ps
     �Hello
Nice

There's also an integer underflow when passing -1.

@pierrec
Copy link
Owner

pierrec commented Jan 3, 2024

Thanks for the report, let me have a look.

@pierrec
Copy link
Owner

pierrec commented Jan 3, 2024

Please check with d9eb671.

@pierrec
Copy link
Owner

pierrec commented Jan 8, 2024

Closing, plz reopen if needed.

@pierrec pierrec closed this as completed Jan 8, 2024
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

No branches or pull requests

2 participants