As get_best_eci() can no longer return 0 remove caller checks

library: simplify dealing one-letter escapes into one case;
  other fiddlings (`first_err` -> `warn_number`)
This commit is contained in:
gitlost
2024-03-05 22:09:05 +00:00
parent 11b3c18aed
commit 624574a64c
10 changed files with 80 additions and 144 deletions

View File

@ -795,10 +795,7 @@ INTERNAL int get_best_eci_segs(struct zint_symbol *symbol, struct zint_seg segs[
for (i = 0; i < seg_count; i++) {
if (segs[i].eci == 0) {
int eci = get_best_eci(segs[i].source, segs[i].length);
if (eci == 0) {
return 0;
}
const int eci = get_best_eci(segs[i].source, segs[i].length);
if (eci == default_eci) {
if (i != 0 && segs[i - 1].eci != 0 && segs[i - 1].eci != default_eci) {
segs[i].eci = eci;