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];