mirror of
https://git.code.sf.net/p/zint/code
synced 2025-05-28 14:04:19 -04: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
1 changed files with 10 additions and 1 deletions
|
@ -1063,7 +1063,16 @@ static int dm200encode_remainder(unsigned char target[], int target_length, cons
|
||||||
target_length++;
|
target_length++;
|
||||||
}
|
}
|
||||||
} else {
|
} 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) {
|
if (process_p == 1) {
|
||||||
target[target_length] = (unsigned char) ((process_buffer[0] << 2) + ((31 & 0x30) >> 4));
|
target[target_length] = (unsigned char) ((process_buffer[0] << 2) + ((31 & 0x30) >> 4));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue