mirror of
https://github.com/zint/zint
synced 2024-11-16 20:57:25 +13:00
Add trailing spaces to Mailmark if not present in input data
This commit is contained in:
parent
389bcce10f
commit
f655eabc12
@ -146,12 +146,27 @@ int mailmark(struct zint_symbol *symbol, unsigned char source[], int length) {
|
|||||||
int check_count;
|
int check_count;
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
||||||
if ((length != 22) && (length != 26)) {
|
if (length > 26) {
|
||||||
strcpy(symbol->errtxt, "580: Invalid length input");
|
strcpy(symbol->errtxt, "580: Input too long");
|
||||||
return ZINT_ERROR_INVALID_DATA;
|
return ZINT_ERROR_TOO_LONG;
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy(local_source, (char*) source);
|
strcpy(local_source, (char*) source);
|
||||||
|
|
||||||
|
if (length < 22) {
|
||||||
|
for (i = length; i <= 22; i++) {
|
||||||
|
strcat(local_source, " ");
|
||||||
|
}
|
||||||
|
length = 22;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((length > 22) && (length < 26)) {
|
||||||
|
for (i = length; i <= 26; i++) {
|
||||||
|
strcat(local_source, " ");
|
||||||
|
}
|
||||||
|
length = 26;
|
||||||
|
}
|
||||||
|
|
||||||
to_upper((unsigned char*) local_source);
|
to_upper((unsigned char*) local_source);
|
||||||
|
|
||||||
if (symbol->debug) {
|
if (symbol->debug) {
|
||||||
@ -159,7 +174,7 @@ int mailmark(struct zint_symbol *symbol, unsigned char source[], int length) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (is_sane(RUBIDIUM, (unsigned char *) local_source, length) != 0) {
|
if (is_sane(RUBIDIUM, (unsigned char *) local_source, length) != 0) {
|
||||||
strcpy(symbol->errtxt, "581: Invalid characters or format in input data");
|
strcpy(symbol->errtxt, "581: Invalid characters in input data");
|
||||||
return ZINT_ERROR_INVALID_DATA;
|
return ZINT_ERROR_INVALID_DATA;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1726,7 +1726,9 @@ generated by Zint.
|
|||||||
Developed in 2014 as a replacement for RM4SCC this 4-state symbol includes
|
Developed in 2014 as a replacement for RM4SCC this 4-state symbol includes
|
||||||
Reed Solomon error correction. Input is a pre-formatted alpanumeric string of
|
Reed Solomon error correction. Input is a pre-formatted alpanumeric string of
|
||||||
22 (for Barcode C) or 26 (for Barcode L) characters, producing a symbol with
|
22 (for Barcode C) or 26 (for Barcode L) characters, producing a symbol with
|
||||||
66 or 78 bars respectively.
|
66 or 78 bars respectively. Some of the permitted inputs include a number of
|
||||||
|
trailing space characters - these will be appended by Zint if not included in
|
||||||
|
the input data.
|
||||||
|
|
||||||
6.5.5 USPS OneCode
|
6.5.5 USPS OneCode
|
||||||
------------------
|
------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user