]> granicus.if.org Git - apache/commitdiff
This should be clean... ap_snprintf already holds a byte for the
authorWilliam A. Rowe Jr <wrowe@apache.org>
Tue, 25 Jul 2000 02:05:49 +0000 (02:05 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Tue, 25 Jul 2000 02:05:49 +0000 (02:05 +0000)
  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

index 717263c397a7e80356bbbaeb1e623446c3be7577..00e09ad6d4a609c8d3eec0b85355d9d6f81a562d 100644 (file)
@@ -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);