From 84fb2aec2364c8a6f8cca719a5a3b7fcb558c0f3 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 25 Jul 2000 02:05:49 +0000 Subject: [PATCH] This should be clean... ap_snprintf already holds a byte for the null terminator, and this patch sets aside whatever space is needed for the newline termination. PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85880 13f79535-47bb-0310-9956-ffa450edef68 --- server/log.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/log.c b/server/log.c index 717263c397..00e09ad6d4 100644 --- a/server/log.c +++ b/server/log.c @@ -428,8 +428,8 @@ static void log_error_core(const char *file, int line, int level, /* NULL if we are logging to syslog */ if (logf) { /* Truncate for the terminator (as ap_snprintf does) */ - if (len > MAX_STRING_LEN - 2) - len = MAX_STRING_LEN - 2; + if (len > MAX_STRING_LEN - sizeof(APR_EOL_STR)) + len = MAX_STRING_LEN - sizeof(APR_EOL_STR); strcpy(errstr + len, APR_EOL_STR); ap_puts(errstr, logf); ap_flush(logf); -- 2.50.1