zstd
zstd copied to clipboard
`zstd` CLI accepts bogus values for numeric parameters
Describe the bug
CLI parameters which are intended to accept numerical values (including those which take on optional suffix to denote the magnitude of the value) do not check that the values passed are well-formed.
To reproduce
For example, try running the lastest version of zstd as shown below:
zstd --memory=32LB file.txt
Expected behavior
I expected for zstd to reject the value passed for --memory since "LB" isn't a meaningful unit (perhaps the user made a typo and intended to say "KB"). This issue extends to even further malformed inputs, for instance the below example is also accepted without raising an error:
zstd --memory=hello file.txt
because no one believes me when I ask others to help. I also lose track of things like this. I apologize to everyone. Thank you very much for what you did from the beginning. I will try to study them. I'm really sorry.
Fixed in #3268