Skip to content

Commit 0cf4fb2

Browse files
committed
Fix blank line detection in rastertolabel (Issue #1545)
1 parent 51fb4c8 commit 0cf4fb2

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ Changes in CUPS v2.4.17 (YYYY-MM-DD)
4141
- Fixed a recursion issue with encoding of nested collections (Issue #1539)
4242
- Fixed parsing of the `LimitRequestBody`, `MaxLogSize`, and `MaxRequestSize`
4343
directives in "cupsd.conf" (Issue #1540)
44+
- Fixed blank line detection in the `rastertolabel` filter (Issue #1545)
4445

4546

4647
Changes in CUPS v2.4.16 (2025-12-04)

filter/rastertolabel.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* Label printer filter for CUPS.
33
*
4-
* Copyright © 2020-2024 by OpenPrinting.
4+
* Copyright © 2020-2026 by OpenPrinting.
55
* Copyright © 2007-2019 by Apple Inc.
66
* Copyright © 2001-2007 by Easy Software Products.
77
*
@@ -758,8 +758,7 @@ OutputLine(ppd_file_t *ppd, /* I - PPD file */
758758
* See if the line is blank; if not, write it to the printer...
759759
*/
760760

761-
if (Buffer[0] ||
762-
memcmp(Buffer, Buffer + 1, header->cupsBytesPerLine - 1))
761+
if (Buffer[0] || memcmp(Buffer, Buffer + 1, header->cupsBytesPerLine - 1))
763762
{
764763
if (Feed)
765764
{
@@ -788,7 +787,7 @@ OutputLine(ppd_file_t *ppd, /* I - PPD file */
788787
break;
789788

790789
case ZEBRA_EPL_PAGE :
791-
if (Buffer[0] || memcmp(Buffer, Buffer + 1, header->cupsBytesPerLine))
790+
if (Buffer[0] || memcmp(Buffer, Buffer + 1, header->cupsBytesPerLine - 1))
792791
{
793792
printf("GW0,%d,%d,1\n", y, header->cupsBytesPerLine);
794793
for (i = header->cupsBytesPerLine, ptr = Buffer; i > 0; i --, ptr ++)
@@ -872,7 +871,7 @@ OutputLine(ppd_file_t *ppd, /* I - PPD file */
872871
break;
873872

874873
case ZEBRA_CPCL :
875-
if (Buffer[0] || memcmp(Buffer, Buffer + 1, header->cupsBytesPerLine))
874+
if (Buffer[0] || memcmp(Buffer, Buffer + 1, header->cupsBytesPerLine - 1))
876875
{
877876
printf("CG %u 1 0 %d ", header->cupsBytesPerLine, y);
878877
fwrite(Buffer, 1, header->cupsBytesPerLine, stdout);
@@ -882,8 +881,7 @@ OutputLine(ppd_file_t *ppd, /* I - PPD file */
882881
break;
883882

884883
case INTELLITECH_PCL :
885-
if (Buffer[0] ||
886-
memcmp(Buffer, Buffer + 1, header->cupsBytesPerLine - 1))
884+
if (Buffer[0] || memcmp(Buffer, Buffer + 1, header->cupsBytesPerLine - 1))
887885
{
888886
if (Feed)
889887
{

0 commit comments

Comments
 (0)