Skip to content

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

@corneliusroemer

Description

@corneliusroemer

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions