diff options
author | msweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be> | 2011-08-09 21:32:14 +0000 |
---|---|---|
committer | msweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be> | 2011-08-09 21:32:14 +0000 |
commit | 771bd8cbffe1ffb06d90b2c7f00191830e6b738c (patch) | |
tree | b243e530d49ceb689d2597438ed7fbdc428e03a0 /scheduler/log.c | |
parent | bd8b6777d63a527fce541b948c3305e5a59ed2af (diff) | |
download | cups-771bd8cbffe1ffb06d90b2c7f00191830e6b738c.tar.gz |
Merge changes from CUPS 1.5.1-r9875.
git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@3363 a1ca3aef-8c08-0410-bb20-df032aa958be
Diffstat (limited to 'scheduler/log.c')
-rw-r--r-- | scheduler/log.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/scheduler/log.c b/scheduler/log.c index 1e363d031..de7b5458f 100644 --- a/scheduler/log.c +++ b/scheduler/log.c @@ -444,7 +444,7 @@ cupsdLogJob(cupsd_job_t *job, /* I - Job */ va_end(ap); } while (status == 0); - + if (status > 0) { if ((level > LogLevel || @@ -567,8 +567,8 @@ cupsdLogPage(cupsd_job_t *job, /* I - Job being printed */ const char *format, /* Pointer into PageLogFormat */ *nameend; /* End of attribute name */ ipp_attribute_t *attr; /* Current attribute */ - int number; /* Page number */ - char copies[256]; /* Number of copies */ + char number[256]; /* Page number */ + int copies; /* Number of copies */ /* @@ -578,9 +578,9 @@ cupsdLogPage(cupsd_job_t *job, /* I - Job being printed */ if (!PageLogFormat) return (1); - number = 1; - strcpy(copies, "1"); - sscanf(page, "%d%255s", &number, copies); + strcpy(number, "1"); + copies = 1; + sscanf(page, "%255s%d", number, &copies); for (format = PageLogFormat, bufptr = buffer; *format; format ++) { @@ -619,12 +619,12 @@ cupsdLogPage(cupsd_job_t *job, /* I - Job being printed */ break; case 'P' : /* Page number */ - snprintf(bufptr, sizeof(buffer) - (bufptr - buffer), "%d", number); + strlcpy(bufptr, number, sizeof(buffer) - (bufptr - buffer)); bufptr += strlen(bufptr); break; case 'C' : /* Number of copies */ - strlcpy(bufptr, copies, sizeof(buffer) - (bufptr - buffer)); + snprintf(bufptr, sizeof(buffer) - (bufptr - buffer), "%d", copies); bufptr += strlen(bufptr); break; @@ -713,7 +713,7 @@ cupsdLogPage(cupsd_job_t *job, /* I - Job being printed */ } *bufptr = '\0'; - + #ifdef HAVE_VSYSLOG /* * See if we are logging pages via syslog... @@ -875,7 +875,7 @@ cupsdLogRequest(cupsd_client_t *con, /* I - Request to log */ CUPSD_ACCESSLOG_ACTIONS,/* CUPS-Authenticate-Job */ CUPSD_ACCESSLOG_ALL /* CUPS-Get-PPD */ }; - + if ((op <= IPP_SCHEDULE_JOB_AFTER && standard_ops[op] > AccessLogLevel) || (op >= CUPS_GET_DEFAULT && op <= CUPS_GET_PPD && |