Skip to content

Commit 4816d4c

Browse files
committed
Allow empty string for resolution values (Issue #63)
1 parent 2e65bf0 commit 4816d4c

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ libcups v3.0rc2 (2024-10-15)
77
- Updated `httpConnectAgain` to re-validate the server's X.509 certificate
88
(Issue #90)
99
- Updated the source tarball script to include the PDFio sources.
10+
- Fixed handling of empty resolution values passed to `ipptool` (Issue #63)
1011
- Fixed a compressed file error handling bug (Issue #91)
1112
- Fixed the default User-Agent string sent in requests.
1213
- Fixed a recursion issue in `ippReadIO`.

cups/ipp-file.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// IPP data file functions.
33
//
4-
// Copyright © 2021-2022 by OpenPrinting.
4+
// Copyright © 2021-2024 by OpenPrinting.
55
// Copyright © 2007-2019 by Apple Inc.
66
// Copyright © 1997-2007 by Easy Software Products.
77
//
@@ -1706,7 +1706,7 @@ parse_value(ipp_file_t *file, // I - IPP data file
17061706
yres = (int)strtol(ptr + 1, (char **)&ptr, 10);
17071707
}
17081708

1709-
if (ptr <= value || xres <= 0 || yres <= 0 || !ptr || (_cups_strcasecmp(ptr, "dpi") && _cups_strcasecmp(ptr, "dpc") && _cups_strcasecmp(ptr, "dpcm") && _cups_strcasecmp(ptr, "other")))
1709+
if (*value && (ptr <= value || xres <= 0 || yres <= 0 || !ptr || (_cups_strcasecmp(ptr, "dpi") && _cups_strcasecmp(ptr, "dpc") && _cups_strcasecmp(ptr, "dpcm") && _cups_strcasecmp(ptr, "other"))))
17101710
{
17111711
report_error(file, "Bad resolution value \"%s\" on line %d of '%s'.", value, file->linenum, file->filename);
17121712
return (false);

0 commit comments

Comments
 (0)