mirror of
https://github.com/zint/zint
synced 2024-11-16 20:57:25 +13:00
Fix of by one errors when searching from right to left.
This commit is contained in:
parent
4561a66067
commit
9553e96f8a
@ -220,7 +220,7 @@ static int aztec_text_process(const unsigned char source[], const unsigned int s
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* look for adjacent blocks which can use the same table (right to left search) */
|
/* look for adjacent blocks which can use the same table (right to left search) */
|
||||||
for (i = blocks - 1; i > 0; i--) {
|
for (i = blocks - 1 - 1; i >= 0; i--) {
|
||||||
if (blockmap[0][i] & blockmap[0][i + 1]) {
|
if (blockmap[0][i] & blockmap[0][i + 1]) {
|
||||||
blockmap[0][i] = (blockmap[0][i] & blockmap[0][i + 1]);
|
blockmap[0][i] = (blockmap[0][i] & blockmap[0][i + 1]);
|
||||||
}
|
}
|
||||||
@ -247,7 +247,7 @@ static int aztec_text_process(const unsigned char source[], const unsigned int s
|
|||||||
do {
|
do {
|
||||||
if (blockmap[0][i] == blockmap[0][i + 1]) {
|
if (blockmap[0][i] == blockmap[0][i + 1]) {
|
||||||
blockmap[1][i] += blockmap[1][i + 1];
|
blockmap[1][i] += blockmap[1][i + 1];
|
||||||
for (j = i + 1; j < blocks; j++) {
|
for (j = i + 1; j < blocks - 1; j++) {
|
||||||
blockmap[0][j] = blockmap[0][j + 1];
|
blockmap[0][j] = blockmap[0][j + 1];
|
||||||
blockmap[1][j] = blockmap[1][j + 1];
|
blockmap[1][j] = blockmap[1][j + 1];
|
||||||
}
|
}
|
||||||
@ -255,7 +255,7 @@ static int aztec_text_process(const unsigned char source[], const unsigned int s
|
|||||||
} else {
|
} else {
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
} while (i < blocks);
|
} while (i < blocks - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Put the adjusted block data back into typemap */
|
/* Put the adjusted block data back into typemap */
|
||||||
|
Loading…
Reference in New Issue
Block a user