mirror of
https://github.com/zint/zint
synced 2024-11-16 20:57:25 +13:00
Bugfix: Insertion of unlatch character in EDIFACT mode will unlatch immediately, not at the end of the 24-bit block
Fixes #60, Ref: ISO para 5.2.8.2. Bug report thanks to ice4x800@sf
This commit is contained in:
parent
4c8de6399f
commit
a1327cbd0d
@ -1056,15 +1056,10 @@ static int dm200encode_remainder(unsigned char target[], int target_length, cons
|
||||
target_length++;
|
||||
}
|
||||
} else {
|
||||
// Append edifact unlatch value (31) and encode as triple
|
||||
|
||||
// Append edifact unlatch value (31) and empty buffer
|
||||
if (process_p == 0) {
|
||||
target[target_length] = (unsigned char) (31 << 2);
|
||||
target_length++;
|
||||
target[target_length] = 0;
|
||||
target_length++;
|
||||
target[target_length] = 0;
|
||||
target_length++;
|
||||
}
|
||||
|
||||
if (process_p == 1) {
|
||||
@ -1072,8 +1067,6 @@ static int dm200encode_remainder(unsigned char target[], int target_length, cons
|
||||
target_length++;
|
||||
target[target_length] = (unsigned char) ((31 & 0x0f) << 4);
|
||||
target_length++;
|
||||
target[target_length] = (unsigned char) 0;
|
||||
target_length++;
|
||||
}
|
||||
|
||||
if (process_p == 2) {
|
||||
@ -1093,7 +1086,6 @@ static int dm200encode_remainder(unsigned char target[], int target_length, cons
|
||||
target[target_length] = (unsigned char) (((process_buffer[2] & 0x03) << 6) + 31);
|
||||
target_length++;
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user