From 34c33b45b57dcb7528849608247d48f97b241ded Mon Sep 17 00:00:00 2001 From: Harald Oehlmann Date: Thu, 5 Dec 2019 19:36:00 +0100 Subject: [PATCH] Correct mistake of last commit: restore order of blocks --- backend/qr.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/backend/qr.c b/backend/qr.c index 52e81fe1..0f7db6f3 100644 --- a/backend/qr.c +++ b/backend/qr.c @@ -525,17 +525,17 @@ static void add_ecc(unsigned char fullstream[], const unsigned char datastream[] unsigned char* interleaved_ecc; #endif - short_data_block_length = data_cw / blocks; - qty_long_blocks = data_cw % blocks; - qty_short_blocks = blocks - qty_long_blocks; - ecc_block_length = ecc_cw / blocks; - if (version < RMQR_VERSION) { ecc_cw = qr_total_codewords[version - 1] - data_cw; } else { ecc_cw = rmqr_total_codewords[version - RMQR_VERSION] - data_cw; } + short_data_block_length = data_cw / blocks; + qty_long_blocks = data_cw % blocks; + qty_short_blocks = blocks - qty_long_blocks; + ecc_block_length = ecc_cw / blocks; + #ifndef _MSC_VER unsigned char data_block[short_data_block_length + 2];