Blosc/c-blosc2

Incorrect testing of strtol failure modes

pgoodman opened this issue · 2 comments

Describe the bug
strtol to used in a few places. In some places, its return value is compared to error codes, instead of comparing errno to those codes. It also compares to the incorrect error code (EINVAL instead of ERANGE), leading to non-sensical, over-constrained conditions.

Below is an example:
image

To Reproduce
Set environment variable BLOSC_CLEVEL or BLOSC_TYPESIZE or BLOSC_NTHREADS to 22

Expected behavior
No warnings / errors when 22 is used for any of those values.

Logs
If applicable, add logs to help explain your problem.

System information:

  • OS: macOS
  • Compiler: Clang
  • Version: 16

Provided this has been fixed for BLOSC_NTHREADS in 2be8b26, would you mind to contribute a similar patch (ideally in PR form) for the rest of environment variables? Thanks in advance.

Fixed in c94787a