mirror of
https://git.code.sf.net/p/zint/code
synced 2025-05-25 20:44:29 -04:00
Remove unneccessary length checks in Code1
Revokes commit #024490 and re-establishes commit #0c00ec Relating to #184 thanks to Milton Neal and Git Lost
This commit is contained in:
parent
f02851b3c1
commit
b4182cbc19
1 changed files with 6 additions and 10 deletions
|
@ -441,11 +441,9 @@ static int c1_encode(struct zint_symbol *symbol, unsigned char source[], unsigne
|
||||||
|
|
||||||
if (j == 13) {
|
if (j == 13) {
|
||||||
latch = 0;
|
latch = 0;
|
||||||
if ((length - sp) >= 14) {
|
for (i = sp + 13; i < length; i++) {
|
||||||
for (i = sp + 13; i < length; i++) {
|
if (!((source[i] >= '0') && (source[i] <= '9'))) {
|
||||||
if (!((source[i] >= '0') && (source[i] <= '9'))) {
|
latch = 1;
|
||||||
latch = 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -492,11 +490,9 @@ static int c1_encode(struct zint_symbol *symbol, unsigned char source[], unsigne
|
||||||
|
|
||||||
if (j == 7) {
|
if (j == 7) {
|
||||||
latch = 0;
|
latch = 0;
|
||||||
if ((length - sp) >= 8) {
|
for (i = sp + 7; i < length; i++) {
|
||||||
for (i = sp + 7; i < length; i++) {
|
if (!((source[i] >= '0') && (source[i] <= '9'))) {
|
||||||
if (!((source[sp + i] >= '0') && (source[sp + i] <= '9'))) {
|
latch = 1;
|
||||||
latch = 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue