summaryrefslogtreecommitdiff
path: root/log.c
diff options
context:
space:
mode:
Diffstat (limited to 'log.c')
-rw-r--r--log.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/log.c b/log.c
index 2b59c4274..d0f86cf6f 100644
--- a/log.c
+++ b/log.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: log.c,v 1.48 2016/07/15 05:01:58 dtucker Exp $ */ 1/* $OpenBSD: log.c,v 1.49 2017/03/10 03:15:58 djm Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -453,7 +453,8 @@ do_log(LogLevel level, const char *fmt, va_list args)
453 tmp_handler(level, fmtbuf, log_handler_ctx); 453 tmp_handler(level, fmtbuf, log_handler_ctx);
454 log_handler = tmp_handler; 454 log_handler = tmp_handler;
455 } else if (log_on_stderr) { 455 } else if (log_on_stderr) {
456 snprintf(msgbuf, sizeof msgbuf, "%s\r\n", fmtbuf); 456 snprintf(msgbuf, sizeof msgbuf, "%.*s\r\n",
457 (int)sizeof msgbuf - 3, fmtbuf);
457 (void)write(log_stderr_fd, msgbuf, strlen(msgbuf)); 458 (void)write(log_stderr_fd, msgbuf, strlen(msgbuf));
458 } else { 459 } else {
459#if defined(HAVE_OPENLOG_R) && defined(SYSLOG_DATA_INIT) 460#if defined(HAVE_OPENLOG_R) && defined(SYSLOG_DATA_INIT)