mirror of
https://github.com/zint/zint
synced 2024-11-16 20:57:25 +13:00
Unlatch EDIFACT encodation when buffer is empty
bug report and patch by brunt, ticket #46
This commit is contained in:
parent
6af035ba98
commit
1d503c54fe
@ -1063,7 +1063,16 @@ 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 encode as triple
|
||||
|
||||
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) {
|
||||
target[target_length] = (unsigned char) ((process_buffer[0] << 2) + ((31 & 0x30) >> 4));
|
||||
|
Loading…
Reference in New Issue
Block a user