diff options
author | Michael R Sweet <michael.r.sweet@gmail.com> | 2021-04-05 15:57:50 -0400 |
---|---|---|
committer | Michael R Sweet <michael.r.sweet@gmail.com> | 2021-04-05 15:57:50 -0400 |
commit | 064e50fb06e83e6c1756e2a81c2fcbd4d6fca8e6 (patch) | |
tree | 45145c8db9a634af861cb1ed87a7378837e72763 /systemv | |
parent | 6918883fba4942931dc455b32545d6edf18dec5c (diff) | |
download | cups-064e50fb06e83e6c1756e2a81c2fcbd4d6fca8e6.tar.gz |
Import all of the bug fixes from the OpenPrinting CUPS repository.
Import the improvements to ippeveprinter from OpenPrinting/ippsample.
Import the improvements to ippfind and ipptool from OpenPrinting/ippsample.
Diffstat (limited to 'systemv')
-rw-r--r-- | systemv/cancel.c | 2 | ||||
-rw-r--r-- | systemv/lp.c | 18 |
2 files changed, 11 insertions, 9 deletions
diff --git a/systemv/cancel.c b/systemv/cancel.c index c85a86e0c..bcd638cc4 100644 --- a/systemv/cancel.c +++ b/systemv/cancel.c @@ -274,7 +274,7 @@ main(int argc, /* I - Number of command-line arguments */ } else { - sprintf(uri, "ipp://localhost/jobs/%d", job_id); + snprintf(uri, sizeof(uri), "ipp://localhost/jobs/%d", job_id); ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "job-uri", NULL, uri); } diff --git a/systemv/lp.c b/systemv/lp.c index 298c15825..fd818a56d 100644 --- a/systemv/lp.c +++ b/systemv/lp.c @@ -161,6 +161,12 @@ main(int argc, /* I - Number of command-line arguments */ "name."), argv[0]); return (1); } + else if (cupsLastError() == IPP_STATUS_ERROR_NOT_FOUND) + { + _cupsLangPrintf(stderr, + _("%s: Error - The printer or class does not exist."), argv[0]); + return (1); + } break; case 'f' : /* Form */ @@ -280,9 +286,7 @@ main(int argc, /* I - Number of command-line arguments */ return (1); } - sprintf(buffer, "%d", num_copies); - num_options = cupsAddOption("copies", buffer, num_options, - &options); + num_options = cupsAddIntegerOption("copies", num_copies, num_options, &options); break; case 'o' : /* Option */ @@ -342,9 +346,7 @@ main(int argc, /* I - Number of command-line arguments */ return (1); } - sprintf(buffer, "%d", priority); - num_options = cupsAddOption("job-priority", buffer, num_options, - &options); + num_options = cupsAddIntegerOption("job-priority", priority, num_options, &options); break; case 's' : /* Silent */ @@ -660,7 +662,7 @@ restart_job(const char *command, /* I - Command name */ request = ippNewRequest(IPP_RESTART_JOB); - sprintf(uri, "ipp://localhost/jobs/%d", job_id); + snprintf(uri, sizeof(uri), "ipp://localhost/jobs/%d", job_id); ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "job-uri", NULL, uri); @@ -708,7 +710,7 @@ set_job_attrs( request = ippNewRequest(IPP_SET_JOB_ATTRIBUTES); - sprintf(uri, "ipp://localhost/jobs/%d", job_id); + snprintf(uri, sizeof(uri), "ipp://localhost/jobs/%d", job_id); ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "job-uri", NULL, uri); |