From 3117336a0291309ddd2a54d2966a589f9f806850 Mon Sep 17 00:00:00 2001 From: Lasse Collin Date: Fri, 19 Apr 2024 20:51:36 +0300 Subject: [PATCH] Tests: test_lzip_decoder: Remove redundant initializations (cherry picked from commit 38be573a279bd7b608ee7d8509ec10884e6fb0d5) --- tests/test_lzip_decoder.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/test_lzip_decoder.c b/tests/test_lzip_decoder.c index 01a43019..01ae13e8 100644 --- a/tests/test_lzip_decoder.c +++ b/tests/test_lzip_decoder.c @@ -173,12 +173,10 @@ decode_expect_error(const char *src, lzma_ret expected_error) strm.avail_in = file_size; strm.next_in = data; - strm.avail_out = DECODE_CHUNK_SIZE; - strm.next_out = output_buffer; lzma_ret ret = LZMA_OK; - while (ret == LZMA_OK) { + do { // Discard output since we are only looking for errors strm.next_out = output_buffer; strm.avail_out = DECODE_CHUNK_SIZE; @@ -186,7 +184,7 @@ decode_expect_error(const char *src, lzma_ret expected_error) ret = lzma_code(&strm, LZMA_FINISH); else ret = lzma_code(&strm, LZMA_RUN); - } + } while (ret == LZMA_OK); assert_lzma_ret(ret, expected_error); lzma_end(&strm);