Hi all,
In lines 1159 and 1269 in Aztec.c, the indexer 'i' will end up larger than the length of 'binary_string'.
Although this is fixed by placing the null terminator at the end of the valid data of 'adjusted_string', I think this should be corrected.
My suggested fix at lines 1159 & 1269.
I have tested this and works fine.
.
.
if (i < data_length) {
adjusted_string[j] = binary_string[i];
j++;
i++;
}
} while (i < data_length);
.
.
Cheers Milton
Hi Milton,
Thank you for this report - I don't know how the code ended up like this, but it seems unnecessarily complicated. I have replaced this section with a for loop which I think is much easier to understand, uses less memory and avoids this problem. Please let me know if you are happy with this solution.
Robin.
Hi Robin, tried your solution and found that some my test data would not generate barcodes that would scan correctly. I reverted back to the original code and ran my test data again and all was ok.
So currently i'm trying to figure out where the problems lies in your updated code. I'll get back to you when i find the issue. In the mean time maybe you can check it out your end.
Thanks Milton
Hi Milton, Robin, I noticed this while looking at #191 as the test suite fails. Basically new code counting B bits instead of B-1 bits I think. We do MR now...
Hello Robin, Martin
Tested the lastest fix (B-1) and all my test data works fine including HIBC and GS1 data.
Thanks for your work.
Milton
Thanks very much Milton.