summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2019-05-15 22:38:07 -0400
committerMichael R Sweet <michael.r.sweet@gmail.com>2019-05-15 22:38:07 -0400
commitbed16f192bdbff3029d0dfdcaf208352b18d121a (patch)
tree05136942437bc3ba2e59b71c093b5a67d822c066 /tools
parent3894a8854421f2e246b47bccec2c66de727da9e0 (diff)
downloadcups-bed16f192bdbff3029d0dfdcaf208352b18d121a.tar.gz
Fix Windows build errors.
Diffstat (limited to 'tools')
-rw-r--r--tools/ippeveprinter.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/tools/ippeveprinter.c b/tools/ippeveprinter.c
index b5ba8fb6e..954b910d0 100644
--- a/tools/ippeveprinter.c
+++ b/tools/ippeveprinter.c
@@ -19,6 +19,7 @@
*/
#include <cups/cups-private.h>
+#include <cups/debug-private.h>
#if !CUPS_LITE
# include <cups/ppd-private.h>
#endif /* !CUPS_LITE */
@@ -6013,15 +6014,21 @@ process_job(ippeve_job_t *job) /* I - Job */
goto error;
}
- if (asprintf(myenvp + myenvc, "CONTENT_TYPE=%s", job->format) > 0)
- myenvc ++;
+ snprintf(val, sizeof(val), "CONTENT_TYPE=%s", job->format);
+ myenvp[myenvc ++] = strdup(val);
- if (job->printer->device_uri && asprintf(myenvp + myenvc, "DEVICE_URI=%s", job->printer->device_uri) > 0)
- myenvc ++;
+ if (job->printer->device_uri)
+ {
+ snprintf(val, sizeof(val), "DEVICE_URI=%s", job->printer->device_uri);
+ myenvp[myenvc ++] = strdup(val);
+ }
#if !CUPS_LITE
- if (job->printer->ppdfile && asprintf(myenvp + myenvc, "PPD=%s", job->printer->ppdfile) > 0)
- myenvc ++;
+ if (job->printer->ppdfile)
+ {
+ snprintf(val, sizeof(val), "PPD=%s", job->printer->ppdfile);
+ myenvp[myenvc++] = strdup(val);
+ }
#endif /* !CUPS_LITE */
for (attr = ippFirstAttribute(job->printer->attrs); attr && myenvc < (int)(sizeof(myenvp) / sizeof(myenvp[0]) - 1); attr = ippNextAttribute(job->printer->attrs))