-
Notifications
You must be signed in to change notification settings - Fork 10
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
Error in the example of using the LimitOutput parameter #21
Comments
Hey @true-alex - - sorry for the delay in responding. Good catch! Looking at this I initially didn't think there was an error at all, but I crafted some code that triggered an error with the code in the example Thinking about this some more, rather than using
I will use this for the loop condition
Below are quotes from the
The two return code |
Fixed in version 2.205 which is now uploaded to CPAN . |
2.205 16 July 2023 * 2.205 Sun, 16 Jul 2023 16:11:31 +0100 3effdb9dbaa9bedfff3cad44902e515409ffae78 * Test::More::isn't warns in perl 5.38 Sun, 9 Jul 2023 21:38:15 +0100 928bbc6ddc5178621fb477b38a1b4b4de38866cf * add zlib-ng 2.1.3 Thu, 29 Jun 2023 19:51:58 +0100 b1aa2583b4c114c2194890a0e015fdc439928c31 * add zlib-ng 2.1.2 Fri, 9 Jun 2023 14:51:17 +0100 0d505d9156ca7e9cac15e2d6e574099300f91a14 * Change storage of ZLIBNG_VER_STATUS from IV to PV pmqs/Compress-Raw-Zlib#24 Fri, 9 Jun 2023 14:30:36 +0100 0a8fb7141a43b8e49609fb06f05fad5150a97c2a * Fix to allow building with C++17 register keyword not allowed in C++17 pmqs/Compress-Raw-Zlib#23 Mon, 22 May 2023 12:42:51 +0100 a7c12acdd4ce7fdc070f50ac78e68e04c8699c81 * Change while loop for `LimitOutput` example pmqs/Compress-Raw-Zlib#21 Sun, 21 May 2023 21:32:19 +0100 972f03b5b0bf06d44991bbee2d2c9216e4175154 * [doc] zlib.h: Remove duplicate "the" (#22) Mon, 1 May 2023 22:46:39 +0200 89b43e6978d8e9b16801f48881cadf822585be0d * Add zlib compat version for 2.0.7 Sat, 18 Mar 2023 08:42:59 +0000 e7d79cbd5924fbdcd3515fb3b0ad171c7720105c
Changelog: =========== * drop rt.cpan from SUPPORT section * Test::More::isn't warns in perl 5.38 * add zlib-ng 2.1.3 * add zlib-ng 2.1.2 * Change storage of ZLIBNG_VER_STATUS from IV to PV pmqs/Compress-Raw-Zlib#24 * Fix to allow building with C++17 register keyword not allowed in C++17 pmqs/Compress-Raw-Zlib#23 * Change while loop for `LimitOutput` example pmqs/Compress-Raw-Zlib#21 * [doc] zlib.h: Remove duplicate "the" (openembedded#22) * Add zlib compat version for 2.0.7 Signed-off-by: Wang Mingyu <wangmy@fujitsu.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Changelog: =========== * drop rt.cpan from SUPPORT section * Test::More::isn't warns in perl 5.38 * add zlib-ng 2.1.3 * add zlib-ng 2.1.2 * Change storage of ZLIBNG_VER_STATUS from IV to PV pmqs/Compress-Raw-Zlib#24 * Fix to allow building with C++17 register keyword not allowed in C++17 pmqs/Compress-Raw-Zlib#23 * Change while loop for `LimitOutput` example pmqs/Compress-Raw-Zlib#21 * [doc] zlib.h: Remove duplicate "the" (#22) * Add zlib compat version for 2.0.7 Signed-off-by: Wang Mingyu <wangmy@fujitsu.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
The inner loop must be repeated as long as the Z_BUF_ERROR status is set.
The Z_BUF_ERROR status means that Zlib has more data to output, but the size of the output variable has already reached the maximum allowed size. In this case, you need to re-call inflate without adding anything to the input.
The example says this:
} while ($status == Z_OK && length $input);
but that's not true it should be
} while ($status == Z_BUF_ERROR && length $input);
The text was updated successfully, but these errors were encountered: