Project

General

Profile

Bug #2811 » dntpd.patch

bycn82, 04/23/2015 01:00 PM

View differences:

usr.sbin/dntpd/log.c
{
static char line_build[1024];
static int line_index;
int priority;
int priority, used = 0;
va_list va2;
/*
* Output to stderr directly but build the log line for syslog.
*/
if (level <= debug_level) {
if (log_stderr) {
used = 1;
va_copy(va2, va);
vfprintf(stderr, ctl, va);
if (newline)
fprintf(stderr, "\n");
fflush(stderr);
}
if (debug_opt == 0) {
vsnprintf(line_build + line_index, sizeof(line_build) - line_index,
ctl, va);
if (used == 0)
vsnprintf(line_build + line_index,
sizeof(line_build) - line_index,
ctl, va);
else
vsnprintf(line_build + line_index,
sizeof(line_build) - line_index,
ctl, va2);
line_index += strlen(line_build + line_index);
if (line_index && line_build[line_index-1] == '\n') {
newline = 1;
(2-2/4)